Tag Archives: matlab
uigetfile canceled returns 0, converting my string to a scalar
when I call [infile, location] = uigetfile() and it’s canceled, it returns 0s, converting my strings to a scalars
Next time I call it I get an error:
Error using uigetputfile_helper/checkString
Filename must be a character vector or a string scalar.
How do I get my string back for infile to be properly used next time?
This shouldn’t be that hard! I even tried converting the vars back to strings but it still fails after a cancel loop
function LoadfromTextFileButtonPushed(app, event)
% Open the file in the Load trials text
if isempty(app.loc)
[infile, app.loc] = uigetfile(‘*.txt’,’Select a Stimulus File’,app.defLoc);
else
[infile, app.loc] = uigetfile(‘*.txt’,’Select a Stimulus File’,app.loc);
end
if infile == 0 % user canceled
app.FileName.Text = ‘Click Load From Text File or enter manually’;
% give me back a string var for next time
infile = ”;
app.loc = app.defLoc; % return to default string
return;
end
% Put full file name into the File field name and read it in
locfile = fullfile(app.loc,infile);
app.FileName.Text = locfile;
app.UITable2.Data = readtable(locfile);
endwhen I call [infile, location] = uigetfile() and it’s canceled, it returns 0s, converting my strings to a scalars
Next time I call it I get an error:
Error using uigetputfile_helper/checkString
Filename must be a character vector or a string scalar.
How do I get my string back for infile to be properly used next time?
This shouldn’t be that hard! I even tried converting the vars back to strings but it still fails after a cancel loop
function LoadfromTextFileButtonPushed(app, event)
% Open the file in the Load trials text
if isempty(app.loc)
[infile, app.loc] = uigetfile(‘*.txt’,’Select a Stimulus File’,app.defLoc);
else
[infile, app.loc] = uigetfile(‘*.txt’,’Select a Stimulus File’,app.loc);
end
if infile == 0 % user canceled
app.FileName.Text = ‘Click Load From Text File or enter manually’;
% give me back a string var for next time
infile = ”;
app.loc = app.defLoc; % return to default string
return;
end
% Put full file name into the File field name and read it in
locfile = fullfile(app.loc,infile);
app.FileName.Text = locfile;
app.UITable2.Data = readtable(locfile);
end when I call [infile, location] = uigetfile() and it’s canceled, it returns 0s, converting my strings to a scalars
Next time I call it I get an error:
Error using uigetputfile_helper/checkString
Filename must be a character vector or a string scalar.
How do I get my string back for infile to be properly used next time?
This shouldn’t be that hard! I even tried converting the vars back to strings but it still fails after a cancel loop
function LoadfromTextFileButtonPushed(app, event)
% Open the file in the Load trials text
if isempty(app.loc)
[infile, app.loc] = uigetfile(‘*.txt’,’Select a Stimulus File’,app.defLoc);
else
[infile, app.loc] = uigetfile(‘*.txt’,’Select a Stimulus File’,app.loc);
end
if infile == 0 % user canceled
app.FileName.Text = ‘Click Load From Text File or enter manually’;
% give me back a string var for next time
infile = ”;
app.loc = app.defLoc; % return to default string
return;
end
% Put full file name into the File field name and read it in
locfile = fullfile(app.loc,infile);
app.FileName.Text = locfile;
app.UITable2.Data = readtable(locfile);
end uigetfile, cancel MATLAB Answers — New Questions
Error message “‘sequenceInputLayer requires Deep Learning Toolbox” running MATLAB from terminal
I am training an LSTM network (script called lstm_classification.m) on some time series data (MATLAB R2024a). Training uses the Deep Learning toolbox which is installed correctly. When I run the script from the GUI everything works fine, but when I call the script from R, I get the following error message:
sequenceInputLayer requires Deep Learning Toolbox.
Error in lstm_classification (line 463) sequenceInputLayer(inputSize)
Error in run (line 112)
evalin(‘caller’, strcat(script, ‘;’));
Calling the script from R used to work without issues. This error message occured only recently. This is my script lstm_classification.m around line 463 (sequenceInputLayer…):
…
%% Define LSTM Network Architecture
inputSize=nofeatures;
% numHiddenUnits=100;
numHiddenUnits=hiddenunits;
% numClasses=9;
numClasses=notreatments_afterdrop;
layers=[ …
sequenceInputLayer(inputSize)
bilstmLayer(numHiddenUnits,’OutputMode’,’last’)
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer
];
…
What is the matter here? Is the toolbox now not accesible without the MATLAB-GUI running? It used to work perfectly. Any help is greatly appreciated. Thanks.I am training an LSTM network (script called lstm_classification.m) on some time series data (MATLAB R2024a). Training uses the Deep Learning toolbox which is installed correctly. When I run the script from the GUI everything works fine, but when I call the script from R, I get the following error message:
sequenceInputLayer requires Deep Learning Toolbox.
Error in lstm_classification (line 463) sequenceInputLayer(inputSize)
Error in run (line 112)
evalin(‘caller’, strcat(script, ‘;’));
Calling the script from R used to work without issues. This error message occured only recently. This is my script lstm_classification.m around line 463 (sequenceInputLayer…):
…
%% Define LSTM Network Architecture
inputSize=nofeatures;
% numHiddenUnits=100;
numHiddenUnits=hiddenunits;
% numClasses=9;
numClasses=notreatments_afterdrop;
layers=[ …
sequenceInputLayer(inputSize)
bilstmLayer(numHiddenUnits,’OutputMode’,’last’)
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer
];
…
What is the matter here? Is the toolbox now not accesible without the MATLAB-GUI running? It used to work perfectly. Any help is greatly appreciated. Thanks. I am training an LSTM network (script called lstm_classification.m) on some time series data (MATLAB R2024a). Training uses the Deep Learning toolbox which is installed correctly. When I run the script from the GUI everything works fine, but when I call the script from R, I get the following error message:
sequenceInputLayer requires Deep Learning Toolbox.
Error in lstm_classification (line 463) sequenceInputLayer(inputSize)
Error in run (line 112)
evalin(‘caller’, strcat(script, ‘;’));
Calling the script from R used to work without issues. This error message occured only recently. This is my script lstm_classification.m around line 463 (sequenceInputLayer…):
…
%% Define LSTM Network Architecture
inputSize=nofeatures;
% numHiddenUnits=100;
numHiddenUnits=hiddenunits;
% numClasses=9;
numClasses=notreatments_afterdrop;
layers=[ …
sequenceInputLayer(inputSize)
bilstmLayer(numHiddenUnits,’OutputMode’,’last’)
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer
];
…
What is the matter here? Is the toolbox now not accesible without the MATLAB-GUI running? It used to work perfectly. Any help is greatly appreciated. Thanks. sequenceinputlayer, deeplearning toolbox MATLAB Answers — New Questions
how to configure the block simulink block related to LDPC coded with MQAM and OFDM over AWGN and Rayleigh channel
i build block which as follow: integer source generator >>>LDPC encoder>>> 16QAM >>>Rayleigh fading and AWGN channel >>>then the inverse of previous steps and i add ber calculation and to workspace simout to plot relation between Eb/No vs BER ..
but the simulink doesnot run because of issue in configurations …
so kindly i need the help to understand configuration
the attached is the filei build block which as follow: integer source generator >>>LDPC encoder>>> 16QAM >>>Rayleigh fading and AWGN channel >>>then the inverse of previous steps and i add ber calculation and to workspace simout to plot relation between Eb/No vs BER ..
but the simulink doesnot run because of issue in configurations …
so kindly i need the help to understand configuration
the attached is the file i build block which as follow: integer source generator >>>LDPC encoder>>> 16QAM >>>Rayleigh fading and AWGN channel >>>then the inverse of previous steps and i add ber calculation and to workspace simout to plot relation between Eb/No vs BER ..
but the simulink doesnot run because of issue in configurations …
so kindly i need the help to understand configuration
the attached is the file wireless communication, digital communication, error correction code, ofdm, ldpc, qam MATLAB Answers — New Questions
jetson camera image is rotated on target device
I am attempting to run this example:
https://www.mathworks.com/help/coder/nvidia/ug/deploy-and-run-sobel-edge-detection-with-i-o-on-nvidia-jetson.html
Everything works great but for some reason the camera window and image are rotated -90 degrees. Is there a way to send a message to rotate the image? when I run this command on the target: ffplay /dev/video0, it looks fine.I am attempting to run this example:
https://www.mathworks.com/help/coder/nvidia/ug/deploy-and-run-sobel-edge-detection-with-i-o-on-nvidia-jetson.html
Everything works great but for some reason the camera window and image are rotated -90 degrees. Is there a way to send a message to rotate the image? when I run this command on the target: ffplay /dev/video0, it looks fine. I am attempting to run this example:
https://www.mathworks.com/help/coder/nvidia/ug/deploy-and-run-sobel-edge-detection-with-i-o-on-nvidia-jetson.html
Everything works great but for some reason the camera window and image are rotated -90 degrees. Is there a way to send a message to rotate the image? when I run this command on the target: ffplay /dev/video0, it looks fine. jetson, gpu coder, video, webcam, display MATLAB Answers — New Questions
How to use contourf to plot a mesh not generated in matlab, i.e. imported mesh coordinates from abaqus. The issue is that coordinates are not sequential.
I’m trying to use contourf with x and y coordinates being random or non sequential. I have z value for each X y coordinate. Normaly we would create a rectangular mesh and then fill up the z values. Here the issue is that the geometry is meshed in abaqus and the mesh nodes and element related information is fed to my code. Now the nodes are not sequential matrix.I’m trying to use contourf with x and y coordinates being random or non sequential. I have z value for each X y coordinate. Normaly we would create a rectangular mesh and then fill up the z values. Here the issue is that the geometry is meshed in abaqus and the mesh nodes and element related information is fed to my code. Now the nodes are not sequential matrix. I’m trying to use contourf with x and y coordinates being random or non sequential. I have z value for each X y coordinate. Normaly we would create a rectangular mesh and then fill up the z values. Here the issue is that the geometry is meshed in abaqus and the mesh nodes and element related information is fed to my code. Now the nodes are not sequential matrix. contourf, meshing coordinates, abaqus mesh. MATLAB Answers — New Questions
MRI T1 Map production from multiple Flip Angles
I’ve edited a MATLAB code that produces a T1 map from two flip angles. I have MRI slices that are 5×170 slices for 5 different flip angles (2,10,11,12,13). I converted them into .nii files and performed the matlab code which worked. It displays 2 rows of T1 maps for each set of angles. The first row of images represent the T1 values from the initial iteration, which are essentially the initial guesses of the T1 relaxation times. These values are based on the raw data without the iterative refinement process applied. The second row of images represent the T1 values after the iterative refinement process has been completed (after 10 iterations). These values are more accurate and have been corrected for residual T1 saturation effects through the iterative process. However, my T1 maps that came out have a lot of noise especially in the background and don’t look like a normal T1 map, can anyone help me understand why this might be?I’ve edited a MATLAB code that produces a T1 map from two flip angles. I have MRI slices that are 5×170 slices for 5 different flip angles (2,10,11,12,13). I converted them into .nii files and performed the matlab code which worked. It displays 2 rows of T1 maps for each set of angles. The first row of images represent the T1 values from the initial iteration, which are essentially the initial guesses of the T1 relaxation times. These values are based on the raw data without the iterative refinement process applied. The second row of images represent the T1 values after the iterative refinement process has been completed (after 10 iterations). These values are more accurate and have been corrected for residual T1 saturation effects through the iterative process. However, my T1 maps that came out have a lot of noise especially in the background and don’t look like a normal T1 map, can anyone help me understand why this might be? I’ve edited a MATLAB code that produces a T1 map from two flip angles. I have MRI slices that are 5×170 slices for 5 different flip angles (2,10,11,12,13). I converted them into .nii files and performed the matlab code which worked. It displays 2 rows of T1 maps for each set of angles. The first row of images represent the T1 values from the initial iteration, which are essentially the initial guesses of the T1 relaxation times. These values are based on the raw data without the iterative refinement process applied. The second row of images represent the T1 values after the iterative refinement process has been completed (after 10 iterations). These values are more accurate and have been corrected for residual T1 saturation effects through the iterative process. However, my T1 maps that came out have a lot of noise especially in the background and don’t look like a normal T1 map, can anyone help me understand why this might be? mri, t1 map MATLAB Answers — New Questions
Plotting (threshold, peaks etc.) in Signal Analyzer App
Hello everybody out there using MATLAB,
Despite doing elaborate analyzes by coding with text, I like the Signal Analyzer App for visual exploration of a signal.
However, I quickly hit the limits of what is offered by the GUI and was wondering, whether there is a convenient way to plot a certain threshold as a line, to put labels at the output of the findpeaks functions etc.Hello everybody out there using MATLAB,
Despite doing elaborate analyzes by coding with text, I like the Signal Analyzer App for visual exploration of a signal.
However, I quickly hit the limits of what is offered by the GUI and was wondering, whether there is a convenient way to plot a certain threshold as a line, to put labels at the output of the findpeaks functions etc. Hello everybody out there using MATLAB,
Despite doing elaborate analyzes by coding with text, I like the Signal Analyzer App for visual exploration of a signal.
However, I quickly hit the limits of what is offered by the GUI and was wondering, whether there is a convenient way to plot a certain threshold as a line, to put labels at the output of the findpeaks functions etc. signal processing, signal analyzer app MATLAB Answers — New Questions
Write this code in MATLAB.
Write this code in MATLAB.
1. As of early 2018, Usain Bolt holds the world record in the men’s 100-meter dash. It is 9.58 seconds. What was his average speed in km/h? Assign the result to a variable called hundred.
2. Kenyan Eliud Kipchoge set a new world record for men of 2:01:39 on September 16, 2018. Assign his average speed in km/h to the variable marathon. The marathon distance is 42.195 kilometers.
Expert AnswerWrite this code in MATLAB.
1. As of early 2018, Usain Bolt holds the world record in the men’s 100-meter dash. It is 9.58 seconds. What was his average speed in km/h? Assign the result to a variable called hundred.
2. Kenyan Eliud Kipchoge set a new world record for men of 2:01:39 on September 16, 2018. Assign his average speed in km/h to the variable marathon. The marathon distance is 42.195 kilometers.
Expert Answer Write this code in MATLAB.
1. As of early 2018, Usain Bolt holds the world record in the men’s 100-meter dash. It is 9.58 seconds. What was his average speed in km/h? Assign the result to a variable called hundred.
2. Kenyan Eliud Kipchoge set a new world record for men of 2:01:39 on September 16, 2018. Assign his average speed in km/h to the variable marathon. The marathon distance is 42.195 kilometers.
Expert Answer MATLAB Answers — New Questions
what type of deep learning network?
I would like to ask about what the type of deep learning network using to train a network with numerical features the matlab example exist here
https://www.mathworks.com/help/deeplearning/ug/train-network-on-data-set-of-numeric-features.html
it uses the layers
layers = [
featureInputLayer(numFeatures,Normalization="zscore")
fullyConnectedLayer(50)
batchNormalizationLayer
reluLayer
fullyConnectedLayer(numClasses)
softmaxLayer];
what the type of this deep learning network?I would like to ask about what the type of deep learning network using to train a network with numerical features the matlab example exist here
https://www.mathworks.com/help/deeplearning/ug/train-network-on-data-set-of-numeric-features.html
it uses the layers
layers = [
featureInputLayer(numFeatures,Normalization="zscore")
fullyConnectedLayer(50)
batchNormalizationLayer
reluLayer
fullyConnectedLayer(numClasses)
softmaxLayer];
what the type of this deep learning network? I would like to ask about what the type of deep learning network using to train a network with numerical features the matlab example exist here
https://www.mathworks.com/help/deeplearning/ug/train-network-on-data-set-of-numeric-features.html
it uses the layers
layers = [
featureInputLayer(numFeatures,Normalization="zscore")
fullyConnectedLayer(50)
batchNormalizationLayer
reluLayer
fullyConnectedLayer(numClasses)
softmaxLayer];
what the type of this deep learning network? deep learning MATLAB Answers — New Questions
Trainnetwork to Trainnet conversion
Hi there,
I was using Trainnetwork(https://www.mathworks.com/help/deeplearning/ref/trainnetwork.html#mw_408bdd15-2d34-4c0d-ad91-bc83942f7493) function for my study. However, in 2024b trainnet function(https://www.mathworks.com/help/deeplearning/ref/trainnet.html#mw_ffa5eeae-b6e0-444e-a464-91e257cef95b) is slightly faster in computing. I try to convert my Trainnetwork function to trainnet but i can’t managed. How can i convert it? My code is written below. Thank you.
%% Train network part
numClasses = numel(categories(trainImgs.Labels));
dropoutProb = 0.2;
layers = […%my network layers in here.
%% Training Options
options = trainingOptions(‘adam’, …
‘Plots’,’training-progress’,"MiniBatchSize",64, …
‘ValidationData’,valImgs,"ExecutionEnvironment","gpu")
%% Training network
trainednet = trainNetwork(trainImgs,layers,options)
% trainednet = trainnet(trainImgs,layers,"crossentropy",options)Hi there,
I was using Trainnetwork(https://www.mathworks.com/help/deeplearning/ref/trainnetwork.html#mw_408bdd15-2d34-4c0d-ad91-bc83942f7493) function for my study. However, in 2024b trainnet function(https://www.mathworks.com/help/deeplearning/ref/trainnet.html#mw_ffa5eeae-b6e0-444e-a464-91e257cef95b) is slightly faster in computing. I try to convert my Trainnetwork function to trainnet but i can’t managed. How can i convert it? My code is written below. Thank you.
%% Train network part
numClasses = numel(categories(trainImgs.Labels));
dropoutProb = 0.2;
layers = […%my network layers in here.
%% Training Options
options = trainingOptions(‘adam’, …
‘Plots’,’training-progress’,"MiniBatchSize",64, …
‘ValidationData’,valImgs,"ExecutionEnvironment","gpu")
%% Training network
trainednet = trainNetwork(trainImgs,layers,options)
% trainednet = trainnet(trainImgs,layers,"crossentropy",options) Hi there,
I was using Trainnetwork(https://www.mathworks.com/help/deeplearning/ref/trainnetwork.html#mw_408bdd15-2d34-4c0d-ad91-bc83942f7493) function for my study. However, in 2024b trainnet function(https://www.mathworks.com/help/deeplearning/ref/trainnet.html#mw_ffa5eeae-b6e0-444e-a464-91e257cef95b) is slightly faster in computing. I try to convert my Trainnetwork function to trainnet but i can’t managed. How can i convert it? My code is written below. Thank you.
%% Train network part
numClasses = numel(categories(trainImgs.Labels));
dropoutProb = 0.2;
layers = […%my network layers in here.
%% Training Options
options = trainingOptions(‘adam’, …
‘Plots’,’training-progress’,"MiniBatchSize",64, …
‘ValidationData’,valImgs,"ExecutionEnvironment","gpu")
%% Training network
trainednet = trainNetwork(trainImgs,layers,options)
% trainednet = trainnet(trainImgs,layers,"crossentropy",options) trainnet, trainnetwork, neural network, cnn, ai, deep learning, toolbox MATLAB Answers — New Questions
how to import parameters (weights and bias) in simulink
Hello experts,
I have parameters (weights and bias) saved in mat file.
and I use matlab function block in my simulink model to use this parameters.
the problem that the simulink can not read the parameters and give me this error:
How can I solve this issue??Hello experts,
I have parameters (weights and bias) saved in mat file.
and I use matlab function block in my simulink model to use this parameters.
the problem that the simulink can not read the parameters and give me this error:
How can I solve this issue?? Hello experts,
I have parameters (weights and bias) saved in mat file.
and I use matlab function block in my simulink model to use this parameters.
the problem that the simulink can not read the parameters and give me this error:
How can I solve this issue?? simulink, parameters MATLAB Answers — New Questions
How to display geographic gridlines or tickmarks on the current figure and underlay it by a terrain basemap?
I have plottted this map using the following STAMPS command
"ps_plot(‘hgt’)" which plots a map over elevation values for a study area whose boundaries were cropped/predetrmined by numerous processing steps. I eventually would like to display gridlines or tick on intersections over this map in order to be able to export it as png or tiff image so I can manually georeference this map on other softwares.
Additionally, if matlab can plot already georeferenced/geocoded maps, please let me know how to do it!I have plottted this map using the following STAMPS command
"ps_plot(‘hgt’)" which plots a map over elevation values for a study area whose boundaries were cropped/predetrmined by numerous processing steps. I eventually would like to display gridlines or tick on intersections over this map in order to be able to export it as png or tiff image so I can manually georeference this map on other softwares.
Additionally, if matlab can plot already georeferenced/geocoded maps, please let me know how to do it! I have plottted this map using the following STAMPS command
"ps_plot(‘hgt’)" which plots a map over elevation values for a study area whose boundaries were cropped/predetrmined by numerous processing steps. I eventually would like to display gridlines or tick on intersections over this map in order to be able to export it as png or tiff image so I can manually georeference this map on other softwares.
Additionally, if matlab can plot already georeferenced/geocoded maps, please let me know how to do it! image processing, digital image processing, colormap, machine learning MATLAB Answers — New Questions
How can I execute the empirical mode decomposition (emd) syntax in MATLAB R2016b?
Hello, I want to inform you that I am currently using MATLAB version R2016b. Please guide me through executing the empirical mode decomposition (emd) syntax.
Best regards,
NavidHello, I want to inform you that I am currently using MATLAB version R2016b. Please guide me through executing the empirical mode decomposition (emd) syntax.
Best regards,
Navid Hello, I want to inform you that I am currently using MATLAB version R2016b. Please guide me through executing the empirical mode decomposition (emd) syntax.
Best regards,
Navid empirical mode decomposition (emd) MATLAB Answers — New Questions
Field ii ultrasound simulation: Unable to run C compiled binary files (mexw64 extension)
In Field ii ultrasound simulation library a particular function field_init needs to be run initially. Here is the code for the m-file containing a binary complied function Mat_field that Matlab does not seem to recognize:
function res = field_init (suppress)
% Call the C-part of the program to initialize it
if (nargin==1)
Mat_field (5001,suppress);
else
Mat_field (5001,1);
end
Here is what I get when I invoke this function. Matlab does not seem to recognize Mat_field function tho the files Mat_field.mexw64 exists:
field_init
Unrecognized function or variable ‘Mat_field’.
Error in field_init (line 25)
Mat_field (5001,1);In Field ii ultrasound simulation library a particular function field_init needs to be run initially. Here is the code for the m-file containing a binary complied function Mat_field that Matlab does not seem to recognize:
function res = field_init (suppress)
% Call the C-part of the program to initialize it
if (nargin==1)
Mat_field (5001,suppress);
else
Mat_field (5001,1);
end
Here is what I get when I invoke this function. Matlab does not seem to recognize Mat_field function tho the files Mat_field.mexw64 exists:
field_init
Unrecognized function or variable ‘Mat_field’.
Error in field_init (line 25)
Mat_field (5001,1); In Field ii ultrasound simulation library a particular function field_init needs to be run initially. Here is the code for the m-file containing a binary complied function Mat_field that Matlab does not seem to recognize:
function res = field_init (suppress)
% Call the C-part of the program to initialize it
if (nargin==1)
Mat_field (5001,suppress);
else
Mat_field (5001,1);
end
Here is what I get when I invoke this function. Matlab does not seem to recognize Mat_field function tho the files Mat_field.mexw64 exists:
field_init
Unrecognized function or variable ‘Mat_field’.
Error in field_init (line 25)
Mat_field (5001,1); c compiled files mex file MATLAB Answers — New Questions
how convert arraycell to use with writecell
{’31/07/2024′} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[2486]}
{’01/08/2024′} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[2496]}
{’02/08/2024′} {[ 0]} {[ 0]} {[ 1]} {[ 0]} {[2405]}
{’03/08/2024′} {[ 0]} {[ 1]} {[ 0]} {[ 0]} {[2486]}
i want write file .txt and convert in :
31/07/2024 0 0 0 0 2486
01/08/2024 0 0 0 0 2496
02/08/2024 0 0 2 0 2405
03/08/2024 0 1 0 0 2486
i try to use writecell(AA,’C:TitancancmyTextFile.txt’);
but i see this:
0,0,0,0,0…{’31/07/2024′} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[2486]}
{’01/08/2024′} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[2496]}
{’02/08/2024′} {[ 0]} {[ 0]} {[ 1]} {[ 0]} {[2405]}
{’03/08/2024′} {[ 0]} {[ 1]} {[ 0]} {[ 0]} {[2486]}
i want write file .txt and convert in :
31/07/2024 0 0 0 0 2486
01/08/2024 0 0 0 0 2496
02/08/2024 0 0 2 0 2405
03/08/2024 0 1 0 0 2486
i try to use writecell(AA,’C:TitancancmyTextFile.txt’);
but i see this:
0,0,0,0,0… {’31/07/2024′} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[2486]}
{’01/08/2024′} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[2496]}
{’02/08/2024′} {[ 0]} {[ 0]} {[ 1]} {[ 0]} {[2405]}
{’03/08/2024′} {[ 0]} {[ 1]} {[ 0]} {[ 0]} {[2486]}
i want write file .txt and convert in :
31/07/2024 0 0 0 0 2486
01/08/2024 0 0 0 0 2496
02/08/2024 0 0 2 0 2405
03/08/2024 0 1 0 0 2486
i try to use writecell(AA,’C:TitancancmyTextFile.txt’);
but i see this:
0,0,0,0,0… how convert arraycell to use with writecell MATLAB Answers — New Questions
How to use the class of Interleaved ADC.m?
Why the input signal “analog” should be a scalar? Coud Matlab give an example of m-file scripts to demonstrate its usage?Why the input signal “analog” should be a scalar? Coud Matlab give an example of m-file scripts to demonstrate its usage? Why the input signal “analog” should be a scalar? Coud Matlab give an example of m-file scripts to demonstrate its usage? interleaved adc MATLAB Answers — New Questions
The frequency response between the components obtained from wavelet decomposition and the original signal
Why does the fft of the component corresponding to the last approximation coefficient obtained after wavelet decomposition not match the fft of the original signal in the low-frequency region, resulting in an unsmooth frequency response between the two and varying with the original signal. Is using FFT to solve frequency response unreliable?
clearvars;close all;clc;
fs=10;
dt=1/fs;
t=dt:dt:200;
N=length(t);
signal=(0.2)*randn(1,N);
Max_level=wmaxlev(length(signal),’db10′);
[C,L]=wavedec(signal,Max_level,’fk8′);
level=6;
xL_DWT = wrcoef(‘a’,C,L,’fk8′,level);
xH_DWT=signal-xL_DWT;
%fft
Nfft=length(t);
f_DWT = (1:Nfft/2)*fs/(Nfft);
xL_DWT_fft=fftshift(fft(xL_DWT,Nfft));
xH_DWT_fft=fftshift(fft(xH_DWT,Nfft));
signal_fft=fftshift(fft(signal,Nfft));
wn_low_DWT=xL_DWT_fft./signal_fft;
wn_high_DWT=1-wn_low_DWT;
figure
plot(f_DWT,wn_low_DWT(Nfft/2+1:end));
hold on
plot(f_DWT,wn_high_DWT(Nfft/2+1:end));
ylim([-0.5 2]);
yticks([-0.5:0.5:2])
xlim([0 fs/2^(level-1)]);
xticks([0 fs/2^(level+1) fs/2^(level) fs/2^(level-1)])
xticklabels({‘0′,’fs/2^{i+1}’,’fs/2^{i}’,’fs/2^{i-1}’})Why does the fft of the component corresponding to the last approximation coefficient obtained after wavelet decomposition not match the fft of the original signal in the low-frequency region, resulting in an unsmooth frequency response between the two and varying with the original signal. Is using FFT to solve frequency response unreliable?
clearvars;close all;clc;
fs=10;
dt=1/fs;
t=dt:dt:200;
N=length(t);
signal=(0.2)*randn(1,N);
Max_level=wmaxlev(length(signal),’db10′);
[C,L]=wavedec(signal,Max_level,’fk8′);
level=6;
xL_DWT = wrcoef(‘a’,C,L,’fk8′,level);
xH_DWT=signal-xL_DWT;
%fft
Nfft=length(t);
f_DWT = (1:Nfft/2)*fs/(Nfft);
xL_DWT_fft=fftshift(fft(xL_DWT,Nfft));
xH_DWT_fft=fftshift(fft(xH_DWT,Nfft));
signal_fft=fftshift(fft(signal,Nfft));
wn_low_DWT=xL_DWT_fft./signal_fft;
wn_high_DWT=1-wn_low_DWT;
figure
plot(f_DWT,wn_low_DWT(Nfft/2+1:end));
hold on
plot(f_DWT,wn_high_DWT(Nfft/2+1:end));
ylim([-0.5 2]);
yticks([-0.5:0.5:2])
xlim([0 fs/2^(level-1)]);
xticks([0 fs/2^(level+1) fs/2^(level) fs/2^(level-1)])
xticklabels({‘0′,’fs/2^{i+1}’,’fs/2^{i}’,’fs/2^{i-1}’}) Why does the fft of the component corresponding to the last approximation coefficient obtained after wavelet decomposition not match the fft of the original signal in the low-frequency region, resulting in an unsmooth frequency response between the two and varying with the original signal. Is using FFT to solve frequency response unreliable?
clearvars;close all;clc;
fs=10;
dt=1/fs;
t=dt:dt:200;
N=length(t);
signal=(0.2)*randn(1,N);
Max_level=wmaxlev(length(signal),’db10′);
[C,L]=wavedec(signal,Max_level,’fk8′);
level=6;
xL_DWT = wrcoef(‘a’,C,L,’fk8′,level);
xH_DWT=signal-xL_DWT;
%fft
Nfft=length(t);
f_DWT = (1:Nfft/2)*fs/(Nfft);
xL_DWT_fft=fftshift(fft(xL_DWT,Nfft));
xH_DWT_fft=fftshift(fft(xH_DWT,Nfft));
signal_fft=fftshift(fft(signal,Nfft));
wn_low_DWT=xL_DWT_fft./signal_fft;
wn_high_DWT=1-wn_low_DWT;
figure
plot(f_DWT,wn_low_DWT(Nfft/2+1:end));
hold on
plot(f_DWT,wn_high_DWT(Nfft/2+1:end));
ylim([-0.5 2]);
yticks([-0.5:0.5:2])
xlim([0 fs/2^(level-1)]);
xticks([0 fs/2^(level+1) fs/2^(level) fs/2^(level-1)])
xticklabels({‘0′,’fs/2^{i+1}’,’fs/2^{i}’,’fs/2^{i-1}’}) fft, wavelet, frequency response, decomposition MATLAB Answers — New Questions
How can I manipulate the 2D data to make it smoother
I have the following data represented by the surface plot:
clear; clc;
load(‘data.mat’)
figure;
surf(nXX,nYY,nZZ,’linestyle’,’none’,’facecolor’,’interp’)
hold on
plot3([0, 0.5], [0, 0.145], [2, 2],’Color’,’white’,’LineStyle’,’–‘,’LineWidth’,2);
plot3([0, 0.5], [2*0.145, 0.145], [2, 2],’Color’,’black’,’LineStyle’,’–‘,’LineWidth’,2);
annotation(‘ellipse’,[0.08 0.58 0.18 0.34],’LineWidth’,2);
xlabel(‘C_a’)
ylabel(‘C_d’)
zlabel(‘C_z’)
view(2)
colorbar
set(gca,’FontSize’,13)
I want to remove the blue part inside the ellipse and extend the yellow area smoothly till C_a=0 and above the black dashed line. Although the yellow region appears constant, it actually changes very slowly. I aim to extend this yellow part while preserving its gradual variation.I have the following data represented by the surface plot:
clear; clc;
load(‘data.mat’)
figure;
surf(nXX,nYY,nZZ,’linestyle’,’none’,’facecolor’,’interp’)
hold on
plot3([0, 0.5], [0, 0.145], [2, 2],’Color’,’white’,’LineStyle’,’–‘,’LineWidth’,2);
plot3([0, 0.5], [2*0.145, 0.145], [2, 2],’Color’,’black’,’LineStyle’,’–‘,’LineWidth’,2);
annotation(‘ellipse’,[0.08 0.58 0.18 0.34],’LineWidth’,2);
xlabel(‘C_a’)
ylabel(‘C_d’)
zlabel(‘C_z’)
view(2)
colorbar
set(gca,’FontSize’,13)
I want to remove the blue part inside the ellipse and extend the yellow area smoothly till C_a=0 and above the black dashed line. Although the yellow region appears constant, it actually changes very slowly. I aim to extend this yellow part while preserving its gradual variation. I have the following data represented by the surface plot:
clear; clc;
load(‘data.mat’)
figure;
surf(nXX,nYY,nZZ,’linestyle’,’none’,’facecolor’,’interp’)
hold on
plot3([0, 0.5], [0, 0.145], [2, 2],’Color’,’white’,’LineStyle’,’–‘,’LineWidth’,2);
plot3([0, 0.5], [2*0.145, 0.145], [2, 2],’Color’,’black’,’LineStyle’,’–‘,’LineWidth’,2);
annotation(‘ellipse’,[0.08 0.58 0.18 0.34],’LineWidth’,2);
xlabel(‘C_a’)
ylabel(‘C_d’)
zlabel(‘C_z’)
view(2)
colorbar
set(gca,’FontSize’,13)
I want to remove the blue part inside the ellipse and extend the yellow area smoothly till C_a=0 and above the black dashed line. Although the yellow region appears constant, it actually changes very slowly. I aim to extend this yellow part while preserving its gradual variation. interpolation, fitting MATLAB Answers — New Questions
Find the turing pattern for following equation
the equation is
dx/dt={r/(1-ky) – r0-r1x-[alpha*(1-beta*y)*x]/[a+(1-beta*y)*x]}x
dy/dt={[new-cy/[a+(1-beta*y)*x]}*ythe equation is
dx/dt={r/(1-ky) – r0-r1x-[alpha*(1-beta*y)*x]/[a+(1-beta*y)*x]}x
dy/dt={[new-cy/[a+(1-beta*y)*x]}*y the equation is
dx/dt={r/(1-ky) – r0-r1x-[alpha*(1-beta*y)*x]/[a+(1-beta*y)*x]}x
dy/dt={[new-cy/[a+(1-beta*y)*x]}*y turing MATLAB Answers — New Questions
I have been working on 3D imaging in the form of pixels with spheres in a box and need help in finding out the contact points in between the spheres in the produced pixel data
I have tried finding the exact point by 1st extracting the 2 object from data set of 161*161*105 unit8 in volumesegmenter and then used edge command to observe onle the boundary.I want to know how can I exactract exact contact point between 2 spheres by searching in 105 slices and without using the voxel command to get the co-ordinates.
Here is my code:
%% joining bd1,bd2,bd3,bd4
A=cat(3,Bd1, Bd2,Bd3,Bd4);
B=cat(3,L1,L2,L3,L4);
%% for extracting 2 spheres
T=table(A,B);
P=(T.B=="sphere8");
Q=(T.B=="sphere7");
R=P+Q;
%% visualization of 2 joined spheres
volumeSegmenter(R)
%% making the only edge visible for inspection
SS=edge3(R,"approxcanny",0.5);
SS1=im2double(SS);
volumeSegmenter(SS1)I have tried finding the exact point by 1st extracting the 2 object from data set of 161*161*105 unit8 in volumesegmenter and then used edge command to observe onle the boundary.I want to know how can I exactract exact contact point between 2 spheres by searching in 105 slices and without using the voxel command to get the co-ordinates.
Here is my code:
%% joining bd1,bd2,bd3,bd4
A=cat(3,Bd1, Bd2,Bd3,Bd4);
B=cat(3,L1,L2,L3,L4);
%% for extracting 2 spheres
T=table(A,B);
P=(T.B=="sphere8");
Q=(T.B=="sphere7");
R=P+Q;
%% visualization of 2 joined spheres
volumeSegmenter(R)
%% making the only edge visible for inspection
SS=edge3(R,"approxcanny",0.5);
SS1=im2double(SS);
volumeSegmenter(SS1) I have tried finding the exact point by 1st extracting the 2 object from data set of 161*161*105 unit8 in volumesegmenter and then used edge command to observe onle the boundary.I want to know how can I exactract exact contact point between 2 spheres by searching in 105 slices and without using the voxel command to get the co-ordinates.
Here is my code:
%% joining bd1,bd2,bd3,bd4
A=cat(3,Bd1, Bd2,Bd3,Bd4);
B=cat(3,L1,L2,L3,L4);
%% for extracting 2 spheres
T=table(A,B);
P=(T.B=="sphere8");
Q=(T.B=="sphere7");
R=P+Q;
%% visualization of 2 joined spheres
volumeSegmenter(R)
%% making the only edge visible for inspection
SS=edge3(R,"approxcanny",0.5);
SS1=im2double(SS);
volumeSegmenter(SS1) matlab, image processing, 3d image processing, contact points MATLAB Answers — New Questions