Category: Matlab
Category Archives: Matlab
unable to read GR-401 gps data with gpsdev or gpsReceiver
I have Navisys GR-401 gps receiver which works just fine with SiRF-Live. I know it uses COM3, but I am unable to read data with matlab.
with:
s = serialport(‘COM3’,9600);
gps = gpsdev(s,’OutputFormat’,"timetable");
and
read(gps)
gives error:
Obtaining the required NMEA sentences (RMC, GGA and GSA) is taking longer than expected. Verify the physical connection of the GPS device to the specified serial port and the configuration of the GPS device.
also
gps = gpsReceiver(‘COM3’);
and
read(gps)
gives error
Warning: Unsuccessful read: The input buffer was filled before the Terminator was reached.
‘serial’ unable to read all requested data. For more information on possible reasons, see Serial Read Warnings.
any ideas what is the culprit here?I have Navisys GR-401 gps receiver which works just fine with SiRF-Live. I know it uses COM3, but I am unable to read data with matlab.
with:
s = serialport(‘COM3’,9600);
gps = gpsdev(s,’OutputFormat’,"timetable");
and
read(gps)
gives error:
Obtaining the required NMEA sentences (RMC, GGA and GSA) is taking longer than expected. Verify the physical connection of the GPS device to the specified serial port and the configuration of the GPS device.
also
gps = gpsReceiver(‘COM3’);
and
read(gps)
gives error
Warning: Unsuccessful read: The input buffer was filled before the Terminator was reached.
‘serial’ unable to read all requested data. For more information on possible reasons, see Serial Read Warnings.
any ideas what is the culprit here? I have Navisys GR-401 gps receiver which works just fine with SiRF-Live. I know it uses COM3, but I am unable to read data with matlab.
with:
s = serialport(‘COM3’,9600);
gps = gpsdev(s,’OutputFormat’,"timetable");
and
read(gps)
gives error:
Obtaining the required NMEA sentences (RMC, GGA and GSA) is taking longer than expected. Verify the physical connection of the GPS device to the specified serial port and the configuration of the GPS device.
also
gps = gpsReceiver(‘COM3’);
and
read(gps)
gives error
Warning: Unsuccessful read: The input buffer was filled before the Terminator was reached.
‘serial’ unable to read all requested data. For more information on possible reasons, see Serial Read Warnings.
any ideas what is the culprit here? gps, gr-401 MATLAB Answers — New Questions
delete zeros rows and columns
I try this code to delete all row and column with all zero values in them. It simply works for deleting the columns with all zero values abut it does not work for rows! Can anybody please help me?
data=[0 0 0 0 0 0 0 0; 0 0 2 3 4 0 1 0; 0 0 1 2 3 0 0 0];
data( all( ~any( data), 2 ), : ) = []; % removes all rows with all zero
data( :, all( ~any( data ), 1 ) ) = []; % and columns
I mean the first line (% removes all rows with all zero) does not work!I try this code to delete all row and column with all zero values in them. It simply works for deleting the columns with all zero values abut it does not work for rows! Can anybody please help me?
data=[0 0 0 0 0 0 0 0; 0 0 2 3 4 0 1 0; 0 0 1 2 3 0 0 0];
data( all( ~any( data), 2 ), : ) = []; % removes all rows with all zero
data( :, all( ~any( data ), 1 ) ) = []; % and columns
I mean the first line (% removes all rows with all zero) does not work! I try this code to delete all row and column with all zero values in them. It simply works for deleting the columns with all zero values abut it does not work for rows! Can anybody please help me?
data=[0 0 0 0 0 0 0 0; 0 0 2 3 4 0 1 0; 0 0 1 2 3 0 0 0];
data( all( ~any( data), 2 ), : ) = []; % removes all rows with all zero
data( :, all( ~any( data ), 1 ) ) = []; % and columns
I mean the first line (% removes all rows with all zero) does not work! matrix, array, zeros, delete MATLAB Answers — New Questions
How to find out if a logical array is all zeros?
I have a logical array that is 100×1 logical. sometimes it contains a mix of numbers and sometimes it contains all 0s.
How would i go about making an if statement that checks to see if all 100×1 is 0s and if all 0s = do something
I thought i was correct in using any command but im not sure that works correctly for me..
Thanks!I have a logical array that is 100×1 logical. sometimes it contains a mix of numbers and sometimes it contains all 0s.
How would i go about making an if statement that checks to see if all 100×1 is 0s and if all 0s = do something
I thought i was correct in using any command but im not sure that works correctly for me..
Thanks! I have a logical array that is 100×1 logical. sometimes it contains a mix of numbers and sometimes it contains all 0s.
How would i go about making an if statement that checks to see if all 100×1 is 0s and if all 0s = do something
I thought i was correct in using any command but im not sure that works correctly for me..
Thanks! array, logic, if statement MATLAB Answers — New Questions
I need help in this issue. it’s been long time getting this error.
Unable to perform assignment because the left and right sides have a different number of elements.
Error in EM_RTSS>kalman_filter (line 144)
Z_estimates(n) = Z_est; % Store state estimate
Error in EM_RTSS (line 40)
[Z_estimates, P_estimates] = kalman_filter(A, B, S, sigma, mu1, S1, temp);Unable to perform assignment because the left and right sides have a different number of elements.
Error in EM_RTSS>kalman_filter (line 144)
Z_estimates(n) = Z_est; % Store state estimate
Error in EM_RTSS (line 40)
[Z_estimates, P_estimates] = kalman_filter(A, B, S, sigma, mu1, S1, temp); Unable to perform assignment because the left and right sides have a different number of elements.
Error in EM_RTSS>kalman_filter (line 144)
Z_estimates(n) = Z_est; % Store state estimate
Error in EM_RTSS (line 40)
[Z_estimates, P_estimates] = kalman_filter(A, B, S, sigma, mu1, S1, temp); kalman filter MATLAB Answers — New Questions
How to place random CNT’s in a box domain with random curves and orientation ?
Hi all, what i want is a code that can actually place random carbon nanotubes in a cube domain so that i can use it in comsol livelink MATLAB bellow is a code that puts spheres which i found in this forum i need it based on that.. :
function P = GetRandomSpheres(nWant, Width, Radius)
% INPUT:
% nWant: Number of spheres
% Width: Dimension of 3d box as [1 x 3] double vector
% Radius: Radius of spheres
% OUTPUT:
% P: [nWant x 3] matrix, centers
P = zeros(nWant, 3);
R2 = (2 * Radius) ^ 2; % Squared once instead of SQRT each time
W = Width – 2 * Radius; % Avoid interesction with borders
iLoop = 1; % Security break to avoid infinite loop
nValid = 0;
while nValid < nWant && iLoop < 1e12
newP = rand(1, 3) .* W + Radius;
% Auto-expanding, need Matlab >= R2016b. For earlier versions:
% Dist2 = sum(bsxfun(@minus, P(1:nValid, :), newP) .^ 2, 2);
Dist2 = sum((P(1:nValid, 🙂 – newP) .^ 2, 2);
if all(Dist2 > R2)
% Success: The new point does not touch existing sheres:
nValid = nValid + 1; % Append this point
P(nValid, 🙂 = newP;
end
iLoop = iLoop + 1;
end
% Stop if too few values have been found:
if nValid < nWant
error(‘Cannot find wanted number of points in %d iterations.’, iLoop)
end
end
n = 100;
R = 5;
P = GetRandomSpheres(n, [100, 100, 100], R);
figure
axes(‘NextPlot’, ‘add’, …
‘XLim’, [0, 100], ‘YLim’, [0, 100], ‘ZLim’, [0, 100]);
view(3);
[X, Y, Z] = sphere();
for k = 1:n
surf(X * R + P(k, 1), Y * R + P(k, 2), Z * R + P(k, 3));
endHi all, what i want is a code that can actually place random carbon nanotubes in a cube domain so that i can use it in comsol livelink MATLAB bellow is a code that puts spheres which i found in this forum i need it based on that.. :
function P = GetRandomSpheres(nWant, Width, Radius)
% INPUT:
% nWant: Number of spheres
% Width: Dimension of 3d box as [1 x 3] double vector
% Radius: Radius of spheres
% OUTPUT:
% P: [nWant x 3] matrix, centers
P = zeros(nWant, 3);
R2 = (2 * Radius) ^ 2; % Squared once instead of SQRT each time
W = Width – 2 * Radius; % Avoid interesction with borders
iLoop = 1; % Security break to avoid infinite loop
nValid = 0;
while nValid < nWant && iLoop < 1e12
newP = rand(1, 3) .* W + Radius;
% Auto-expanding, need Matlab >= R2016b. For earlier versions:
% Dist2 = sum(bsxfun(@minus, P(1:nValid, :), newP) .^ 2, 2);
Dist2 = sum((P(1:nValid, 🙂 – newP) .^ 2, 2);
if all(Dist2 > R2)
% Success: The new point does not touch existing sheres:
nValid = nValid + 1; % Append this point
P(nValid, 🙂 = newP;
end
iLoop = iLoop + 1;
end
% Stop if too few values have been found:
if nValid < nWant
error(‘Cannot find wanted number of points in %d iterations.’, iLoop)
end
end
n = 100;
R = 5;
P = GetRandomSpheres(n, [100, 100, 100], R);
figure
axes(‘NextPlot’, ‘add’, …
‘XLim’, [0, 100], ‘YLim’, [0, 100], ‘ZLim’, [0, 100]);
view(3);
[X, Y, Z] = sphere();
for k = 1:n
surf(X * R + P(k, 1), Y * R + P(k, 2), Z * R + P(k, 3));
end Hi all, what i want is a code that can actually place random carbon nanotubes in a cube domain so that i can use it in comsol livelink MATLAB bellow is a code that puts spheres which i found in this forum i need it based on that.. :
function P = GetRandomSpheres(nWant, Width, Radius)
% INPUT:
% nWant: Number of spheres
% Width: Dimension of 3d box as [1 x 3] double vector
% Radius: Radius of spheres
% OUTPUT:
% P: [nWant x 3] matrix, centers
P = zeros(nWant, 3);
R2 = (2 * Radius) ^ 2; % Squared once instead of SQRT each time
W = Width – 2 * Radius; % Avoid interesction with borders
iLoop = 1; % Security break to avoid infinite loop
nValid = 0;
while nValid < nWant && iLoop < 1e12
newP = rand(1, 3) .* W + Radius;
% Auto-expanding, need Matlab >= R2016b. For earlier versions:
% Dist2 = sum(bsxfun(@minus, P(1:nValid, :), newP) .^ 2, 2);
Dist2 = sum((P(1:nValid, 🙂 – newP) .^ 2, 2);
if all(Dist2 > R2)
% Success: The new point does not touch existing sheres:
nValid = nValid + 1; % Append this point
P(nValid, 🙂 = newP;
end
iLoop = iLoop + 1;
end
% Stop if too few values have been found:
if nValid < nWant
error(‘Cannot find wanted number of points in %d iterations.’, iLoop)
end
end
n = 100;
R = 5;
P = GetRandomSpheres(n, [100, 100, 100], R);
figure
axes(‘NextPlot’, ‘add’, …
‘XLim’, [0, 100], ‘YLim’, [0, 100], ‘ZLim’, [0, 100]);
view(3);
[X, Y, Z] = sphere();
for k = 1:n
surf(X * R + P(k, 1), Y * R + P(k, 2), Z * R + P(k, 3));
end matlab, random, java, comsol, geometry, matlab code, programming MATLAB Answers — New Questions
Dynamic dashboard radio button options
Hello!
I was curious if it was possible to make the options of a radio button change based on another radio button.
This is a manually created example that shows visually what I want, but doesn’t actually work. If you pick a different category, the selection options automatically change:Hello!
I was curious if it was possible to make the options of a radio button change based on another radio button.
This is a manually created example that shows visually what I want, but doesn’t actually work. If you pick a different category, the selection options automatically change: Hello!
I was curious if it was possible to make the options of a radio button change based on another radio button.
This is a manually created example that shows visually what I want, but doesn’t actually work. If you pick a different category, the selection options automatically change: dashboard, radio button MATLAB Answers — New Questions
Displaying a struct containing gpuArray fields takes an extremely long time
I find that when I create a struct (or object) whose fields are large gpuArrays, it takes an extremely long time (1-2 minutes) to display the struct at the command line. Example:
>> c.data=gpuArray.rand(266,354,894,’single’);
>> tic; c, toc
c =
struct with fields:
data: [266×354×894 gpuArray]
Elapsed time is 100.266106 seconds.
I have observed this in R2024b on two platforms,
(1) Windows 10; NVIDIA GeForce RTX 4080 SUPER
(2) Windows 11; NVIDIA RTX 5000 Ada Generation
Does anyone know why this might be happening?I find that when I create a struct (or object) whose fields are large gpuArrays, it takes an extremely long time (1-2 minutes) to display the struct at the command line. Example:
>> c.data=gpuArray.rand(266,354,894,’single’);
>> tic; c, toc
c =
struct with fields:
data: [266×354×894 gpuArray]
Elapsed time is 100.266106 seconds.
I have observed this in R2024b on two platforms,
(1) Windows 10; NVIDIA GeForce RTX 4080 SUPER
(2) Windows 11; NVIDIA RTX 5000 Ada Generation
Does anyone know why this might be happening? I find that when I create a struct (or object) whose fields are large gpuArrays, it takes an extremely long time (1-2 minutes) to display the struct at the command line. Example:
>> c.data=gpuArray.rand(266,354,894,’single’);
>> tic; c, toc
c =
struct with fields:
data: [266×354×894 gpuArray]
Elapsed time is 100.266106 seconds.
I have observed this in R2024b on two platforms,
(1) Windows 10; NVIDIA GeForce RTX 4080 SUPER
(2) Windows 11; NVIDIA RTX 5000 Ada Generation
Does anyone know why this might be happening? struct, gpuarray, display MATLAB Answers — New Questions
extract numbers from an image
Howdy,
I would like to extract the numbers inside the squares, how do you recommend I do it.Howdy,
I would like to extract the numbers inside the squares, how do you recommend I do it. Howdy,
I would like to extract the numbers inside the squares, how do you recommend I do it. image-processing, image analysis MATLAB Answers — New Questions
Distinguish incomplete and complete triangles from a given image and display their respective numbers
I have a smoothed edge image and would like to highlight with 2 different colors (green – complete triangle, red – incomplete traingle) and display their respective count (how many incomplete triangles and how many complete triangles). I have attached image for reference.I have a smoothed edge image and would like to highlight with 2 different colors (green – complete triangle, red – incomplete traingle) and display their respective count (how many incomplete triangles and how many complete triangles). I have attached image for reference. I have a smoothed edge image and would like to highlight with 2 different colors (green – complete triangle, red – incomplete traingle) and display their respective count (how many incomplete triangles and how many complete triangles). I have attached image for reference. image processing, detection, triangle, image segmentation MATLAB Answers — New Questions
how to show images at a point in a plot?
I have an autonomous vehicle with a camera that follows a predetermined path. Ive already found a way to save each frame of the video and figure out which lat and long each frame belongs to, what im having trouble with is plotting the images in a for loop. I feel like im close, below is my code:
P = uigetdir(‘C:’);
S1 = dir(fullfile(P,’*.png’));
n_frame = numel(S1);
LatSize = size(Lat1, 1);
LongSize = size(Long1, 1);
FrameCount = LatSize/n_frame;
Lat = Lat1(1:FrameCount:end);
Long = Long1(1:FrameCount:end);
for i = 1:n_frame
F2 = fullfile(S1(i).name);
I{i} = imread(F2(i));
plot(Long, Lat)
axes(‘Position’, [Long(i,:) Lat(i,:) .5 .3])
imshow(I)
end
What am I missing here? I get this error when I run the code:
Unable to find file "F"
The various frames of the video are labeled Frame 0001.png, Frame 0002.png and so, there are 739 frames of the video and I want to plot each frame at the point they were recorded. My ultimate goal is to make it so you can click the plot and the picture will appear but ill deal with that part later. Any help is appreciated, thanks!I have an autonomous vehicle with a camera that follows a predetermined path. Ive already found a way to save each frame of the video and figure out which lat and long each frame belongs to, what im having trouble with is plotting the images in a for loop. I feel like im close, below is my code:
P = uigetdir(‘C:’);
S1 = dir(fullfile(P,’*.png’));
n_frame = numel(S1);
LatSize = size(Lat1, 1);
LongSize = size(Long1, 1);
FrameCount = LatSize/n_frame;
Lat = Lat1(1:FrameCount:end);
Long = Long1(1:FrameCount:end);
for i = 1:n_frame
F2 = fullfile(S1(i).name);
I{i} = imread(F2(i));
plot(Long, Lat)
axes(‘Position’, [Long(i,:) Lat(i,:) .5 .3])
imshow(I)
end
What am I missing here? I get this error when I run the code:
Unable to find file "F"
The various frames of the video are labeled Frame 0001.png, Frame 0002.png and so, there are 739 frames of the video and I want to plot each frame at the point they were recorded. My ultimate goal is to make it so you can click the plot and the picture will appear but ill deal with that part later. Any help is appreciated, thanks! I have an autonomous vehicle with a camera that follows a predetermined path. Ive already found a way to save each frame of the video and figure out which lat and long each frame belongs to, what im having trouble with is plotting the images in a for loop. I feel like im close, below is my code:
P = uigetdir(‘C:’);
S1 = dir(fullfile(P,’*.png’));
n_frame = numel(S1);
LatSize = size(Lat1, 1);
LongSize = size(Long1, 1);
FrameCount = LatSize/n_frame;
Lat = Lat1(1:FrameCount:end);
Long = Long1(1:FrameCount:end);
for i = 1:n_frame
F2 = fullfile(S1(i).name);
I{i} = imread(F2(i));
plot(Long, Lat)
axes(‘Position’, [Long(i,:) Lat(i,:) .5 .3])
imshow(I)
end
What am I missing here? I get this error when I run the code:
Unable to find file "F"
The various frames of the video are labeled Frame 0001.png, Frame 0002.png and so, there are 739 frames of the video and I want to plot each frame at the point they were recorded. My ultimate goal is to make it so you can click the plot and the picture will appear but ill deal with that part later. Any help is appreciated, thanks! imread MATLAB Answers — New Questions
MPU6050 display raw data and fft from the reading get
from this code what is the problem that i faced because the fft not show
a = arduino;
imu = mpu6050(a);
xlabel(‘Count’);
ylabel(‘Acceleration (m/s^2)’);
title(‘Acceleration values from mpu6050 sensor (Z-axis only)’);
z_val = animatedline(‘Color’,’b’);
axis tight;
legend(‘Acceleration in Z-axis’);
stop_time = 100;
count = 1;
tic;
while(toc <= stop_time)
[accel] = readAcceleration(imu);
if ~isempty(accel)
addpoints(z_val,count,accel(:,3));
% Compute FFT of the Z-axis acceleration
fft_z = fft(accel(:,3));
n = length(fft_z);
freq = (0:n-1)*(100/stop_time)/n; % Assuming sampling rate based on stop_time
% Plot the FFT magnitude
subplot(2,1,2);
plot(freq, abs(fft_z));
xlabel(‘Frequency (Hz)’);
ylabel(‘Magnitude’);
title(‘FFT of Z-axis Acceleration’);
drawnow limitrate;
count = count + 1;
end
endfrom this code what is the problem that i faced because the fft not show
a = arduino;
imu = mpu6050(a);
xlabel(‘Count’);
ylabel(‘Acceleration (m/s^2)’);
title(‘Acceleration values from mpu6050 sensor (Z-axis only)’);
z_val = animatedline(‘Color’,’b’);
axis tight;
legend(‘Acceleration in Z-axis’);
stop_time = 100;
count = 1;
tic;
while(toc <= stop_time)
[accel] = readAcceleration(imu);
if ~isempty(accel)
addpoints(z_val,count,accel(:,3));
% Compute FFT of the Z-axis acceleration
fft_z = fft(accel(:,3));
n = length(fft_z);
freq = (0:n-1)*(100/stop_time)/n; % Assuming sampling rate based on stop_time
% Plot the FFT magnitude
subplot(2,1,2);
plot(freq, abs(fft_z));
xlabel(‘Frequency (Hz)’);
ylabel(‘Magnitude’);
title(‘FFT of Z-axis Acceleration’);
drawnow limitrate;
count = count + 1;
end
end from this code what is the problem that i faced because the fft not show
a = arduino;
imu = mpu6050(a);
xlabel(‘Count’);
ylabel(‘Acceleration (m/s^2)’);
title(‘Acceleration values from mpu6050 sensor (Z-axis only)’);
z_val = animatedline(‘Color’,’b’);
axis tight;
legend(‘Acceleration in Z-axis’);
stop_time = 100;
count = 1;
tic;
while(toc <= stop_time)
[accel] = readAcceleration(imu);
if ~isempty(accel)
addpoints(z_val,count,accel(:,3));
% Compute FFT of the Z-axis acceleration
fft_z = fft(accel(:,3));
n = length(fft_z);
freq = (0:n-1)*(100/stop_time)/n; % Assuming sampling rate based on stop_time
% Plot the FFT magnitude
subplot(2,1,2);
plot(freq, abs(fft_z));
xlabel(‘Frequency (Hz)’);
ylabel(‘Magnitude’);
title(‘FFT of Z-axis Acceleration’);
drawnow limitrate;
count = count + 1;
end
end signal processing, mpu6050 MATLAB Answers — New Questions
How the Delay one step block and stop time ( simulation time) infuence each other on simulink?
I want to have a fixed delay on the incoming resources going in the resource pool. For that matter I am using a delay one step block as seen in the attached file. The problem is that, I want to run the simulation let us say for 1000 mins or 10000 mins and the delay in each case be constant but I cannot achieve that. It seems to me there is a connection between the stop time and the delay length in the one step delay block. In the attached file without changing the values inside the blocks and simply by changing the stop time it can be clearly seen in the resource pool scope that this time changes. Any help would be appreciated!I want to have a fixed delay on the incoming resources going in the resource pool. For that matter I am using a delay one step block as seen in the attached file. The problem is that, I want to run the simulation let us say for 1000 mins or 10000 mins and the delay in each case be constant but I cannot achieve that. It seems to me there is a connection between the stop time and the delay length in the one step delay block. In the attached file without changing the values inside the blocks and simply by changing the stop time it can be clearly seen in the resource pool scope that this time changes. Any help would be appreciated! I want to have a fixed delay on the incoming resources going in the resource pool. For that matter I am using a delay one step block as seen in the attached file. The problem is that, I want to run the simulation let us say for 1000 mins or 10000 mins and the delay in each case be constant but I cannot achieve that. It seems to me there is a connection between the stop time and the delay length in the one step delay block. In the attached file without changing the values inside the blocks and simply by changing the stop time it can be clearly seen in the resource pool scope that this time changes. Any help would be appreciated! #simulink, delayonestepblock MATLAB Answers — New Questions
writetable/readtable with multi-line headers
How can I use writetable to make a table to excel sheet and .csv file which has multi-line headers. Headers can include both per-variable headers like units and description, but also per-table headers like description or comments.
For example, take a table like below.
T = table(["Blue";"Red";"Green"],[50;100;75],[0.1;0.5;0.9],…
VariableNames={‘Color’,’Weight’,’Temp’});
T.Properties.VariableUnits = ["[-]";"[kg]";"°C"];
T.Properties.VariableDescriptions = ["Outside Color";"Gross Weight";"Melting Point"];
T.Properties.Description = "Playdough Properties Chart";
Now I want to make it look like this in excel and .csv files
I know to do this by other means, but I would like to be able to do it with writetable, and also to read it back in with readtable.
Is there a straight-forward way of doing this?How can I use writetable to make a table to excel sheet and .csv file which has multi-line headers. Headers can include both per-variable headers like units and description, but also per-table headers like description or comments.
For example, take a table like below.
T = table(["Blue";"Red";"Green"],[50;100;75],[0.1;0.5;0.9],…
VariableNames={‘Color’,’Weight’,’Temp’});
T.Properties.VariableUnits = ["[-]";"[kg]";"°C"];
T.Properties.VariableDescriptions = ["Outside Color";"Gross Weight";"Melting Point"];
T.Properties.Description = "Playdough Properties Chart";
Now I want to make it look like this in excel and .csv files
I know to do this by other means, but I would like to be able to do it with writetable, and also to read it back in with readtable.
Is there a straight-forward way of doing this? How can I use writetable to make a table to excel sheet and .csv file which has multi-line headers. Headers can include both per-variable headers like units and description, but also per-table headers like description or comments.
For example, take a table like below.
T = table(["Blue";"Red";"Green"],[50;100;75],[0.1;0.5;0.9],…
VariableNames={‘Color’,’Weight’,’Temp’});
T.Properties.VariableUnits = ["[-]";"[kg]";"°C"];
T.Properties.VariableDescriptions = ["Outside Color";"Gross Weight";"Melting Point"];
T.Properties.Description = "Playdough Properties Chart";
Now I want to make it look like this in excel and .csv files
I know to do this by other means, but I would like to be able to do it with writetable, and also to read it back in with readtable.
Is there a straight-forward way of doing this? tables, csv, excel MATLAB Answers — New Questions
How do I include a command line in my app when using MATLAB Compiler?
I created an app using the MATLAB App Designer and want to use MATLAB Compiler so others are able to use my app without having MATLAB. The problem I’m running into is that the app asks the user questions in the command window, and I don’t know of a good method to add this command window when compiling.
I know there’s an option when packaging the app to include the Windows Command Shell when the app is opened, but that shel doesn’t allow you to move directories, so it makes adding files to my app more difficult than it needs to be.
Is there a way to include a "customized" command shell in the app that either allows the user to change directories, or is just located in the directory the app is saved in?I created an app using the MATLAB App Designer and want to use MATLAB Compiler so others are able to use my app without having MATLAB. The problem I’m running into is that the app asks the user questions in the command window, and I don’t know of a good method to add this command window when compiling.
I know there’s an option when packaging the app to include the Windows Command Shell when the app is opened, but that shel doesn’t allow you to move directories, so it makes adding files to my app more difficult than it needs to be.
Is there a way to include a "customized" command shell in the app that either allows the user to change directories, or is just located in the directory the app is saved in? I created an app using the MATLAB App Designer and want to use MATLAB Compiler so others are able to use my app without having MATLAB. The problem I’m running into is that the app asks the user questions in the command window, and I don’t know of a good method to add this command window when compiling.
I know there’s an option when packaging the app to include the Windows Command Shell when the app is opened, but that shel doesn’t allow you to move directories, so it makes adding files to my app more difficult than it needs to be.
Is there a way to include a "customized" command shell in the app that either allows the user to change directories, or is just located in the directory the app is saved in? matlab compiler, app designer MATLAB Answers — New Questions
Simulink model output heavily dependent on relative tolerance
I have a relatively large Simulink model that I am validating using a data set. This model is using the ECEF 6DOF block with only a gravitational force as the input.
I have observed that the Simulink model output varies considerably depending on the relative tolerance selected (ranging from 1e-5 to 1e-12), with the output approaching the data set values as the relative tolerance passes below 1e-10. Decreasing the relative tolerance has a significant negative impact on model runtime, so I would like to keep the relative tolerance at a reasonable value while maintaining accuracy in the model results.
Is a significant variation with changing relative tolerance (below the obvious candidates such as >= 1e-5) expected for a typical Simulink model?I have a relatively large Simulink model that I am validating using a data set. This model is using the ECEF 6DOF block with only a gravitational force as the input.
I have observed that the Simulink model output varies considerably depending on the relative tolerance selected (ranging from 1e-5 to 1e-12), with the output approaching the data set values as the relative tolerance passes below 1e-10. Decreasing the relative tolerance has a significant negative impact on model runtime, so I would like to keep the relative tolerance at a reasonable value while maintaining accuracy in the model results.
Is a significant variation with changing relative tolerance (below the obvious candidates such as >= 1e-5) expected for a typical Simulink model? I have a relatively large Simulink model that I am validating using a data set. This model is using the ECEF 6DOF block with only a gravitational force as the input.
I have observed that the Simulink model output varies considerably depending on the relative tolerance selected (ranging from 1e-5 to 1e-12), with the output approaching the data set values as the relative tolerance passes below 1e-10. Decreasing the relative tolerance has a significant negative impact on model runtime, so I would like to keep the relative tolerance at a reasonable value while maintaining accuracy in the model results.
Is a significant variation with changing relative tolerance (below the obvious candidates such as >= 1e-5) expected for a typical Simulink model? relative tolerance MATLAB Answers — New Questions
Using clc in my simple scipt prevents user input question being displayed
I wrote a simple script to ask for a user’s age
age = input(‘What is your age?….’)
This works as expected.
However, if I insert a clc in front of this in the code, it does not display the question to the user in the command window. I don’t know what is happening here.
Any thoughts?
Thanks
NickI wrote a simple script to ask for a user’s age
age = input(‘What is your age?….’)
This works as expected.
However, if I insert a clc in front of this in the code, it does not display the question to the user in the command window. I don’t know what is happening here.
Any thoughts?
Thanks
Nick I wrote a simple script to ask for a user’s age
age = input(‘What is your age?….’)
This works as expected.
However, if I insert a clc in front of this in the code, it does not display the question to the user in the command window. I don’t know what is happening here.
Any thoughts?
Thanks
Nick clc bug MATLAB Answers — New Questions
how can i open .out extension file in matlab?
how can i open .out extension file in matlab ?how can i open .out extension file in matlab ? how can i open .out extension file in matlab ? .out, extension, file MATLAB Answers — New Questions
How to set axis of scatter3?
Hi,
I have a for loop that basically continuously plots points using drawnow corresponding to particles in an explosion. So far, I’ve got the 3D scatter plot to continuously graph the explosion, its just that the axis continually readjusts every couple iterations, and the point motion is distorted because of it. Is there any way to set the axis of scatter3D? I’ve checked online everywhere and couldn’t find an answer. Axis() doesn’t seem to do anything.
ThanksHi,
I have a for loop that basically continuously plots points using drawnow corresponding to particles in an explosion. So far, I’ve got the 3D scatter plot to continuously graph the explosion, its just that the axis continually readjusts every couple iterations, and the point motion is distorted because of it. Is there any way to set the axis of scatter3D? I’ve checked online everywhere and couldn’t find an answer. Axis() doesn’t seem to do anything.
Thanks Hi,
I have a for loop that basically continuously plots points using drawnow corresponding to particles in an explosion. So far, I’ve got the 3D scatter plot to continuously graph the explosion, its just that the axis continually readjusts every couple iterations, and the point motion is distorted because of it. Is there any way to set the axis of scatter3D? I’ve checked online everywhere and couldn’t find an answer. Axis() doesn’t seem to do anything.
Thanks scatter3, 3d plots, plot, data, axis MATLAB Answers — New Questions
Obtaining the P values for the t stat
I have both the tstat and the degrees of freedom, is there a quick way to find the P value of a two tailed hypothesis at a significance of 0.05I have both the tstat and the degrees of freedom, is there a quick way to find the P value of a two tailed hypothesis at a significance of 0.05 I have both the tstat and the degrees of freedom, is there a quick way to find the P value of a two tailed hypothesis at a significance of 0.05 matlab MATLAB Answers — New Questions
tlc_c (InvokeTLC) error when building Matlab R13
Getting the following error when trying to build model. Note: I have not had any environment changes nor changed the tlc files since last successful build:
"Error executing build command: Error using ==> make_rtw
Error using ==> tlc_c
Error using ==> tlc_c (InvokeTLC)
Error: File: C:MATLAB6p5p2rtwctlclibcachelib.tlc Line: 391 Column: 37
Undefined identifier buffer"Getting the following error when trying to build model. Note: I have not had any environment changes nor changed the tlc files since last successful build:
"Error executing build command: Error using ==> make_rtw
Error using ==> tlc_c
Error using ==> tlc_c (InvokeTLC)
Error: File: C:MATLAB6p5p2rtwctlclibcachelib.tlc Line: 391 Column: 37
Undefined identifier buffer" Getting the following error when trying to build model. Note: I have not had any environment changes nor changed the tlc files since last successful build:
"Error executing build command: Error using ==> make_rtw
Error using ==> tlc_c
Error using ==> tlc_c (InvokeTLC)
Error: File: C:MATLAB6p5p2rtwctlclibcachelib.tlc Line: 391 Column: 37
Undefined identifier buffer" real time workshop, error, tlc_c MATLAB Answers — New Questions