Category: Matlab
Category Archives: Matlab
How can I read CDF file?
Dear All,
I have a data with the following format"SW_OPER_TECATMS_2F_20131126T000000_20131126T235959_0401.cdf". How can I read it and extract the relevant dat afrom it such as STEC and VTEC?
Best,
AraDear All,
I have a data with the following format"SW_OPER_TECATMS_2F_20131126T000000_20131126T235959_0401.cdf". How can I read it and extract the relevant dat afrom it such as STEC and VTEC?
Best,
Ara Dear All,
I have a data with the following format"SW_OPER_TECATMS_2F_20131126T000000_20131126T235959_0401.cdf". How can I read it and extract the relevant dat afrom it such as STEC and VTEC?
Best,
Ara cdf files MATLAB Answers — New Questions
Help! I’m having difficulty uploading files from my computer to the Matlab Online
Hello,
I am using MATLAB online for the first time. Unlike the versions that I have used before, my data files do not seem to be stored on the online platform, which means that I have to upload them directly from my computer (rather than the shared space on MATLAB online).
How do I go about this? So far using the command line options e.g. load(C:Users…etc) does not work. The error message is:
Error using load
Unable to read file <pathnamefilename>
Can someone please help me? Thank youHello,
I am using MATLAB online for the first time. Unlike the versions that I have used before, my data files do not seem to be stored on the online platform, which means that I have to upload them directly from my computer (rather than the shared space on MATLAB online).
How do I go about this? So far using the command line options e.g. load(C:Users…etc) does not work. The error message is:
Error using load
Unable to read file <pathnamefilename>
Can someone please help me? Thank you Hello,
I am using MATLAB online for the first time. Unlike the versions that I have used before, my data files do not seem to be stored on the online platform, which means that I have to upload them directly from my computer (rather than the shared space on MATLAB online).
How do I go about this? So far using the command line options e.g. load(C:Users…etc) does not work. The error message is:
Error using load
Unable to read file <pathnamefilename>
Can someone please help me? Thank you upload, file, spreadsheet MATLAB Answers — New Questions
Why does MATLAB Online behave so slowly, and even get stuck on the loading page?
I have been using MATLAB online for several days to work on a project remotely. The most recent time I ran my code, I forgot to suppress the output of a loop that cycles through a cell array, causing a large amount of text to try to display in the command window. I used ctrl+c to kill the program, but the webpage became unresponsive. Now, when I try to load MATLAB Online, I get a message that I have a session active, which asks me to log out of that session and start a new one. The page then gets stuck at its initial loading animation. I have let the page attempt to load for over an hour, with no change.
Related to this, MATLAB Online behaves very slowly, even when typing on the Command Window.
I have also tried clearing my cookies and using a different browser.
I have been using MATLAB online for several days to work on a project remotely. The most recent time I ran my code, I forgot to suppress the output of a loop that cycles through a cell array, causing a large amount of text to try to display in the command window. I used ctrl+c to kill the program, but the webpage became unresponsive. Now, when I try to load MATLAB Online, I get a message that I have a session active, which asks me to log out of that session and start a new one. The page then gets stuck at its initial loading animation. I have let the page attempt to load for over an hour, with no change.
Related to this, MATLAB Online behaves very slowly, even when typing on the Command Window.
I have also tried clearing my cookies and using a different browser.
I have been using MATLAB online for several days to work on a project remotely. The most recent time I ran my code, I forgot to suppress the output of a loop that cycles through a cell array, causing a large amount of text to try to display in the command window. I used ctrl+c to kill the program, but the webpage became unresponsive. Now, when I try to load MATLAB Online, I get a message that I have a session active, which asks me to log out of that session and start a new one. The page then gets stuck at its initial loading animation. I have let the page attempt to load for over an hour, with no change.
Related to this, MATLAB Online behaves very slowly, even when typing on the Command Window.
I have also tried clearing my cookies and using a different browser.
matlab, online, rmdir, login, loading, ctrl+c, print, output, slow, time MATLAB Answers — New Questions
interpolate value of 3D points on a meshgrid with a CUSTOM FUNCTION
% particle to mesh interpolation function (NOT ARBITRARY)
H = 3/pi/rCut^2;
u = @(r) H*(1-r/rCut).*(r.^2<=rCut^2);
for k = 1:length(ptcls.q)
r = sqrt((X – ptcls.x(1, k)).^2 + (Y – ptcls.x(2, k)).^2 + (Z – ptcls.x(3, k)).^2);
rho_lr = rho_lr + ptcls.q(k)*u(r);
end
I want to speed up this simple loop where ptcls.q is the value I want to interpolate, X,Y,Z are the points of a meshgrid and ptcls.x is the 3D scattered position of particles inside the mesh. I cannot use scatteredInterpolant function since is slow and does not fit the math behind the problem, any idea on how to speed up the calculation?% particle to mesh interpolation function (NOT ARBITRARY)
H = 3/pi/rCut^2;
u = @(r) H*(1-r/rCut).*(r.^2<=rCut^2);
for k = 1:length(ptcls.q)
r = sqrt((X – ptcls.x(1, k)).^2 + (Y – ptcls.x(2, k)).^2 + (Z – ptcls.x(3, k)).^2);
rho_lr = rho_lr + ptcls.q(k)*u(r);
end
I want to speed up this simple loop where ptcls.q is the value I want to interpolate, X,Y,Z are the points of a meshgrid and ptcls.x is the 3D scattered position of particles inside the mesh. I cannot use scatteredInterpolant function since is slow and does not fit the math behind the problem, any idea on how to speed up the calculation? % particle to mesh interpolation function (NOT ARBITRARY)
H = 3/pi/rCut^2;
u = @(r) H*(1-r/rCut).*(r.^2<=rCut^2);
for k = 1:length(ptcls.q)
r = sqrt((X – ptcls.x(1, k)).^2 + (Y – ptcls.x(2, k)).^2 + (Z – ptcls.x(3, k)).^2);
rho_lr = rho_lr + ptcls.q(k)*u(r);
end
I want to speed up this simple loop where ptcls.q is the value I want to interpolate, X,Y,Z are the points of a meshgrid and ptcls.x is the 3D scattered position of particles inside the mesh. I cannot use scatteredInterpolant function since is slow and does not fit the math behind the problem, any idea on how to speed up the calculation? interpolation, scattered points, meshgrid MATLAB Answers — New Questions
Using matlab in snaptostamps image processing
I am encoutering this issue which wasn’t happening in older releases, the program cannot plot georeferenced images from the selected data folder due to the following errorI am encoutering this issue which wasn’t happening in older releases, the program cannot plot georeferenced images from the selected data folder due to the following error I am encoutering this issue which wasn’t happening in older releases, the program cannot plot georeferenced images from the selected data folder due to the following error arrays, plotting MATLAB Answers — New Questions
create a 3D average plan (or normal) from two 3D plans (or normals)
How can I determine the average plan knowing the plans of the two attached sets of nodes?
load plan_1_2.mat
figure
plot3(plan_1(:,1),plan_1(:,2),plan_1(:,3),’mo’,’Markersize’,4); % normal 1
hold on
plot3(plan_2(:,1),plan_2(:,2),plan_2(:,3),’go’,’Markersize’,4); % normal 2
hold off
axis equal
xlabel(‘x’)
ylabel(‘y’)
zlabel(‘z’)
grid off
Or, is it possible to create an average normals?How can I determine the average plan knowing the plans of the two attached sets of nodes?
load plan_1_2.mat
figure
plot3(plan_1(:,1),plan_1(:,2),plan_1(:,3),’mo’,’Markersize’,4); % normal 1
hold on
plot3(plan_2(:,1),plan_2(:,2),plan_2(:,3),’go’,’Markersize’,4); % normal 2
hold off
axis equal
xlabel(‘x’)
ylabel(‘y’)
zlabel(‘z’)
grid off
Or, is it possible to create an average normals? How can I determine the average plan knowing the plans of the two attached sets of nodes?
load plan_1_2.mat
figure
plot3(plan_1(:,1),plan_1(:,2),plan_1(:,3),’mo’,’Markersize’,4); % normal 1
hold on
plot3(plan_2(:,1),plan_2(:,2),plan_2(:,3),’go’,’Markersize’,4); % normal 2
hold off
axis equal
xlabel(‘x’)
ylabel(‘y’)
zlabel(‘z’)
grid off
Or, is it possible to create an average normals? norm, normal, average, mean, plan, 3d, 3d plots MATLAB Answers — New Questions
Unable to write to Simulink cache file ‘C:modelname.slxc’ because you do not have write permission for the file.
when I am trying to generate c code from my model, I encounter this error, how to resolve this?
Unable to write to Simulink cache file ‘C:modelname.slxc’ because you do not have write permission for the file.when I am trying to generate c code from my model, I encounter this error, how to resolve this?
Unable to write to Simulink cache file ‘C:modelname.slxc’ because you do not have write permission for the file. when I am trying to generate c code from my model, I encounter this error, how to resolve this?
Unable to write to Simulink cache file ‘C:modelname.slxc’ because you do not have write permission for the file. simulink, code generation MATLAB Answers — New Questions
What is wrong with this code for finding out the number of significant digits after decimal?
I have created this code for finding the number of siignificant digits after decimal for Cody, but for some reason, it shows error (semantic). Can anyone please help identify why? Thank you.
The error comes when I apply:
x = [1.000 1.04 0.22 10.1; 2.05 2.33 4.1 1000.31; 5.00010 6.429 7.492 8.0]
I tried debugging, but the error comes due to 6.429 having a ‘1’ after another 11 zeroes.
Code:
function y = find_max_sigdec(x)
stop = 0;
i = 0;
if x == fix(x)
y = 0;
else
while stop == 0
x = x*10;
i = i+1;
if x == fix(x)
y = i;
stop = 1;
end
end
end
endI have created this code for finding the number of siignificant digits after decimal for Cody, but for some reason, it shows error (semantic). Can anyone please help identify why? Thank you.
The error comes when I apply:
x = [1.000 1.04 0.22 10.1; 2.05 2.33 4.1 1000.31; 5.00010 6.429 7.492 8.0]
I tried debugging, but the error comes due to 6.429 having a ‘1’ after another 11 zeroes.
Code:
function y = find_max_sigdec(x)
stop = 0;
i = 0;
if x == fix(x)
y = 0;
else
while stop == 0
x = x*10;
i = i+1;
if x == fix(x)
y = i;
stop = 1;
end
end
end
end I have created this code for finding the number of siignificant digits after decimal for Cody, but for some reason, it shows error (semantic). Can anyone please help identify why? Thank you.
The error comes when I apply:
x = [1.000 1.04 0.22 10.1; 2.05 2.33 4.1 1000.31; 5.00010 6.429 7.492 8.0]
I tried debugging, but the error comes due to 6.429 having a ‘1’ after another 11 zeroes.
Code:
function y = find_max_sigdec(x)
stop = 0;
i = 0;
if x == fix(x)
y = 0;
else
while stop == 0
x = x*10;
i = i+1;
if x == fix(x)
y = i;
stop = 1;
end
end
end
end significant digits, rounding off MATLAB Answers — New Questions
Distributed digital subarray analysis
clc; clear all; close all;
f = 3e8;
Nx = 10; % number of antennas in subarray
Ns1 = 5;% number of sub array
h = 8; % number of virtual array between subarray
c = 3e8;
lambda = c / f;
dx = 0.42*lambda;
beta = 2 * pi / lambda;
theta = [20];
K = length(theta);
L = round(Nx / 3);
Ri = ones(1,K);
A = 1000;
SNR1 =20;
%% sub array
for Ns = 1 : Ns1
for SNR = 1: SNR1
for l = 1 :A
for m = 1: Ns
for p = 1 : Nx
pos = (m-1)*Nx+p;
P_mp(pos) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
P_mp1(m,p) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
end
end
% P_mp1 = P_mp1 + 2*(0.5-rand(Ns,Nx))*pos_var_amp;
A_mp = [];
A_mp_a = [];
E_mp_a = [];
for i = 1:Ns
E_mp(:,:,i) = exp(-1j*beta*P_mp1(i,:)’*dx*sind(theta)); % pole 값
A_mp(:,:,i) = Ri.*E_mp(:,:,i); % 측정 값
A_mp = awgn(A_mp, SNR, ‘measured’); % noise 추가
A_mp1 = sum(A_mp,2);
A_mc(:,:,i) = A_mp1(1:Nx – L + 1,:,i);
A_mr(:,:,i) = A_mp1(Nx – L + 1:Nx,:,i);
A_mk(:,:,i) = hankel(A_mc(:,:,i), A_mr(:,:,i)); % Create Hankel matrix with A_c as the first column and A_r as the last row
E_mp_a = [E_mp_a; E_mp(:,:,i)];
A_mp_a = [A_mp_a ;A_mp1(:,:,i)];
end
%% Hankel stack
Y_ss = A_mk(:,:,1);
if Ns> 1
for z = 2:Ns
Y_ss = [Y_ss ; A_mk(:,:,z)];
end
else
Y_ss = A_mk(:,:,1);
end
[U, S, V] = svd(Y_ss);
V0 = V(:, 1:K);
V1 = V0(1:end-1, :);
V2 = V0(2:end, :);
z_k = eig(pinv(V1) * V2);
find_theta_realarray_MPM(l,:)= asind((imag(log(z_k))*lambda)/(2*pi*dx))’;
rmse_real_mpm(l,:) = sort(theta) – sort(find_theta_realarray_MPM(l,:));
end
rmse_real_MPM_sum = sum(sum(abs(rmse_real_mpm).^2,1),2);
rmse_real_MPM_sum = sqrt(rmse_real_MPM_sum/(A*K));
rmse_real_MPM_sum1(SNR,Ns)= rmse_real_MPM_sum(rmse_real_MPM_sum ~= 0);
end
end
plot(1:SNR1 , rmse_real_MPM_sum1,’-d’,’LineWidth’,1.4)
legend(‘1-subarray’,’2-subarray’,’3-subarray’,’4-subarray’,’5-subarray’)
I think the RMSE should be lower as the subarray increases, but why is the RMSE reversed when the SNR is low?
plz help me…..clc; clear all; close all;
f = 3e8;
Nx = 10; % number of antennas in subarray
Ns1 = 5;% number of sub array
h = 8; % number of virtual array between subarray
c = 3e8;
lambda = c / f;
dx = 0.42*lambda;
beta = 2 * pi / lambda;
theta = [20];
K = length(theta);
L = round(Nx / 3);
Ri = ones(1,K);
A = 1000;
SNR1 =20;
%% sub array
for Ns = 1 : Ns1
for SNR = 1: SNR1
for l = 1 :A
for m = 1: Ns
for p = 1 : Nx
pos = (m-1)*Nx+p;
P_mp(pos) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
P_mp1(m,p) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
end
end
% P_mp1 = P_mp1 + 2*(0.5-rand(Ns,Nx))*pos_var_amp;
A_mp = [];
A_mp_a = [];
E_mp_a = [];
for i = 1:Ns
E_mp(:,:,i) = exp(-1j*beta*P_mp1(i,:)’*dx*sind(theta)); % pole 값
A_mp(:,:,i) = Ri.*E_mp(:,:,i); % 측정 값
A_mp = awgn(A_mp, SNR, ‘measured’); % noise 추가
A_mp1 = sum(A_mp,2);
A_mc(:,:,i) = A_mp1(1:Nx – L + 1,:,i);
A_mr(:,:,i) = A_mp1(Nx – L + 1:Nx,:,i);
A_mk(:,:,i) = hankel(A_mc(:,:,i), A_mr(:,:,i)); % Create Hankel matrix with A_c as the first column and A_r as the last row
E_mp_a = [E_mp_a; E_mp(:,:,i)];
A_mp_a = [A_mp_a ;A_mp1(:,:,i)];
end
%% Hankel stack
Y_ss = A_mk(:,:,1);
if Ns> 1
for z = 2:Ns
Y_ss = [Y_ss ; A_mk(:,:,z)];
end
else
Y_ss = A_mk(:,:,1);
end
[U, S, V] = svd(Y_ss);
V0 = V(:, 1:K);
V1 = V0(1:end-1, :);
V2 = V0(2:end, :);
z_k = eig(pinv(V1) * V2);
find_theta_realarray_MPM(l,:)= asind((imag(log(z_k))*lambda)/(2*pi*dx))’;
rmse_real_mpm(l,:) = sort(theta) – sort(find_theta_realarray_MPM(l,:));
end
rmse_real_MPM_sum = sum(sum(abs(rmse_real_mpm).^2,1),2);
rmse_real_MPM_sum = sqrt(rmse_real_MPM_sum/(A*K));
rmse_real_MPM_sum1(SNR,Ns)= rmse_real_MPM_sum(rmse_real_MPM_sum ~= 0);
end
end
plot(1:SNR1 , rmse_real_MPM_sum1,’-d’,’LineWidth’,1.4)
legend(‘1-subarray’,’2-subarray’,’3-subarray’,’4-subarray’,’5-subarray’)
I think the RMSE should be lower as the subarray increases, but why is the RMSE reversed when the SNR is low?
plz help me….. clc; clear all; close all;
f = 3e8;
Nx = 10; % number of antennas in subarray
Ns1 = 5;% number of sub array
h = 8; % number of virtual array between subarray
c = 3e8;
lambda = c / f;
dx = 0.42*lambda;
beta = 2 * pi / lambda;
theta = [20];
K = length(theta);
L = round(Nx / 3);
Ri = ones(1,K);
A = 1000;
SNR1 =20;
%% sub array
for Ns = 1 : Ns1
for SNR = 1: SNR1
for l = 1 :A
for m = 1: Ns
for p = 1 : Nx
pos = (m-1)*Nx+p;
P_mp(pos) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
P_mp1(m,p) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
end
end
% P_mp1 = P_mp1 + 2*(0.5-rand(Ns,Nx))*pos_var_amp;
A_mp = [];
A_mp_a = [];
E_mp_a = [];
for i = 1:Ns
E_mp(:,:,i) = exp(-1j*beta*P_mp1(i,:)’*dx*sind(theta)); % pole 값
A_mp(:,:,i) = Ri.*E_mp(:,:,i); % 측정 값
A_mp = awgn(A_mp, SNR, ‘measured’); % noise 추가
A_mp1 = sum(A_mp,2);
A_mc(:,:,i) = A_mp1(1:Nx – L + 1,:,i);
A_mr(:,:,i) = A_mp1(Nx – L + 1:Nx,:,i);
A_mk(:,:,i) = hankel(A_mc(:,:,i), A_mr(:,:,i)); % Create Hankel matrix with A_c as the first column and A_r as the last row
E_mp_a = [E_mp_a; E_mp(:,:,i)];
A_mp_a = [A_mp_a ;A_mp1(:,:,i)];
end
%% Hankel stack
Y_ss = A_mk(:,:,1);
if Ns> 1
for z = 2:Ns
Y_ss = [Y_ss ; A_mk(:,:,z)];
end
else
Y_ss = A_mk(:,:,1);
end
[U, S, V] = svd(Y_ss);
V0 = V(:, 1:K);
V1 = V0(1:end-1, :);
V2 = V0(2:end, :);
z_k = eig(pinv(V1) * V2);
find_theta_realarray_MPM(l,:)= asind((imag(log(z_k))*lambda)/(2*pi*dx))’;
rmse_real_mpm(l,:) = sort(theta) – sort(find_theta_realarray_MPM(l,:));
end
rmse_real_MPM_sum = sum(sum(abs(rmse_real_mpm).^2,1),2);
rmse_real_MPM_sum = sqrt(rmse_real_MPM_sum/(A*K));
rmse_real_MPM_sum1(SNR,Ns)= rmse_real_MPM_sum(rmse_real_MPM_sum ~= 0);
end
end
plot(1:SNR1 , rmse_real_MPM_sum1,’-d’,’LineWidth’,1.4)
legend(‘1-subarray’,’2-subarray’,’3-subarray’,’4-subarray’,’5-subarray’)
I think the RMSE should be lower as the subarray increases, but why is the RMSE reversed when the SNR is low?
plz help me….. ddsa, doa, hankel, svd, snr MATLAB Answers — New Questions
How can I resolve this issue when I try to get c code from simulink model?
Error:Unable to write to Simulink cache file ‘E:Laptop DataPersonalPHD DATAUWPIMyModel.slxc’ because you do not have write permission for the file.Error:Unable to write to Simulink cache file ‘E:Laptop DataPersonalPHD DATAUWPIMyModel.slxc’ because you do not have write permission for the file. Error:Unable to write to Simulink cache file ‘E:Laptop DataPersonalPHD DATAUWPIMyModel.slxc’ because you do not have write permission for the file. code generation MATLAB Answers — New Questions
find the maxima and the maximum
A conical cup is to be made from a circular piece of paper having a radius of 8 cm by cutting out a sector from the paper. Find the maximum capacity of such a cup. derivatives with full solution and drawingA conical cup is to be made from a circular piece of paper having a radius of 8 cm by cutting out a sector from the paper. Find the maximum capacity of such a cup. derivatives with full solution and drawing A conical cup is to be made from a circular piece of paper having a radius of 8 cm by cutting out a sector from the paper. Find the maximum capacity of such a cup. derivatives with full solution and drawing please finf the maxima and maximum. MATLAB Answers — New Questions
I am unable to find the battery builder app from SIMSCAPE BATTERY TRAINING
I was doing simscape battery training and I am unable to find the battery builder app
I tried to find the same from matlab environment still I cannot find it.I was doing simscape battery training and I am unable to find the battery builder app
I tried to find the same from matlab environment still I cannot find it. I was doing simscape battery training and I am unable to find the battery builder app
I tried to find the same from matlab environment still I cannot find it. #simscape battery MATLAB Answers — New Questions
I am using writetable for exporting the workspace variables into excel sheet
I have a excel template in which I export the matlab workspace variables
I am using this code –> writematrix(variables_1,’result.xlsx’,’Sheet’,1,’Range’,’B2′);
After extraction the file changes its column width which I fixed earlier as a templateI have a excel template in which I export the matlab workspace variables
I am using this code –> writematrix(variables_1,’result.xlsx’,’Sheet’,1,’Range’,’B2′);
After extraction the file changes its column width which I fixed earlier as a template I have a excel template in which I export the matlab workspace variables
I am using this code –> writematrix(variables_1,’result.xlsx’,’Sheet’,1,’Range’,’B2′);
After extraction the file changes its column width which I fixed earlier as a template exporting MATLAB Answers — New Questions
How do I retrieve the legend icons property from an existing legend?
Hi,
I have a script that automatically adjusts an existing figure’s linewidth, among other things. It does not work the same with Matlab 2016b. I have modified the script to be 2016b compatible for the most part. It updates the plot line widths but the lines in the legend are not updated. I need to add extra commands in the script to also update the lines in the legend. If I build the legend, I can retrieve the icons property and it is easy:
[~,icons] = legend(‘data 1′,’data 2’);
set(icons,’linewidth’,2);
I need to do this with an existing legend and I cannot find how to retrieve this ‘icons’ propertyHi,
I have a script that automatically adjusts an existing figure’s linewidth, among other things. It does not work the same with Matlab 2016b. I have modified the script to be 2016b compatible for the most part. It updates the plot line widths but the lines in the legend are not updated. I need to add extra commands in the script to also update the lines in the legend. If I build the legend, I can retrieve the icons property and it is easy:
[~,icons] = legend(‘data 1′,’data 2’);
set(icons,’linewidth’,2);
I need to do this with an existing legend and I cannot find how to retrieve this ‘icons’ property Hi,
I have a script that automatically adjusts an existing figure’s linewidth, among other things. It does not work the same with Matlab 2016b. I have modified the script to be 2016b compatible for the most part. It updates the plot line widths but the lines in the legend are not updated. I need to add extra commands in the script to also update the lines in the legend. If I build the legend, I can retrieve the icons property and it is easy:
[~,icons] = legend(‘data 1′,’data 2’);
set(icons,’linewidth’,2);
I need to do this with an existing legend and I cannot find how to retrieve this ‘icons’ property plot MATLAB Answers — New Questions
Simulating engagement of two helical gears
Hello,
I need to simulate two helical gears engagement. One of them is not controllable in terms of revolution. So, it has random revolution per minute. The other one can be controlled in terms of torque and revolution. With a special method, I need to engage these gears. I need to copy behavior of uncontrollable one. After their revolutions are same and steady, at this point I need to engage them.
I may use a PID controller to monitorize and copy uncontrollable one. How can I simulate that?Hello,
I need to simulate two helical gears engagement. One of them is not controllable in terms of revolution. So, it has random revolution per minute. The other one can be controlled in terms of torque and revolution. With a special method, I need to engage these gears. I need to copy behavior of uncontrollable one. After their revolutions are same and steady, at this point I need to engage them.
I may use a PID controller to monitorize and copy uncontrollable one. How can I simulate that? Hello,
I need to simulate two helical gears engagement. One of them is not controllable in terms of revolution. So, it has random revolution per minute. The other one can be controlled in terms of torque and revolution. With a special method, I need to engage these gears. I need to copy behavior of uncontrollable one. After their revolutions are same and steady, at this point I need to engage them.
I may use a PID controller to monitorize and copy uncontrollable one. How can I simulate that? helical gears, pid, simulink, engagement MATLAB Answers — New Questions
tcpclient Sending Nested Strings
I’m trying to send the string below using the Matlab tcpclient. I need to send a string that contains two strings as shown below. I tried converting the entire string below to an asciiArray using the uint8(stringBelow) function and then fwrite(t, asciiArray, ‘uint8’) but that didn’t work either.
Is there a way to send the exact composite string shown below in tcpclient?
>> writeline(t,"Unit.CommandAsText("myFile",1,"Millisecond")")
writeline(t,"Unit.CommandAsText("myFile",1,"Millisecond")")
↑
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error.
To construct matrices, use brackets instead of parentheses.I’m trying to send the string below using the Matlab tcpclient. I need to send a string that contains two strings as shown below. I tried converting the entire string below to an asciiArray using the uint8(stringBelow) function and then fwrite(t, asciiArray, ‘uint8’) but that didn’t work either.
Is there a way to send the exact composite string shown below in tcpclient?
>> writeline(t,"Unit.CommandAsText("myFile",1,"Millisecond")")
writeline(t,"Unit.CommandAsText("myFile",1,"Millisecond")")
↑
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error.
To construct matrices, use brackets instead of parentheses. I’m trying to send the string below using the Matlab tcpclient. I need to send a string that contains two strings as shown below. I tried converting the entire string below to an asciiArray using the uint8(stringBelow) function and then fwrite(t, asciiArray, ‘uint8’) but that didn’t work either.
Is there a way to send the exact composite string shown below in tcpclient?
>> writeline(t,"Unit.CommandAsText("myFile",1,"Millisecond")")
writeline(t,"Unit.CommandAsText("myFile",1,"Millisecond")")
↑
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error.
To construct matrices, use brackets instead of parentheses. tcpclient, string, nested string MATLAB Answers — New Questions
Arrowhead is turning the wrong way
The arrowhead is pointing the wrong way in the x-axis. See figure below.
Definerer alle landes forskydningsbæreevne
clc; clear; close all; clc ;
Forhold = 1/2 ;
Forhold2 = 54/228;
f_vk0 = 0.4 ; % Klæbningsbidrag [MPa]
mu_k = 0.65 ; % Friktionskoefficient
f_bt = 1.00 ; % Trækstyrke af sten [MPa]
f_k = 10.00 ; % Trykstyrke af sten [MPa]
sigma1 = -0.0:0.1:1.6 ;
sigma2 = 0.1:0.1:10.2;
sigma3 = 8.3:0.1:10 ;
sigma23 = 9.1:0.1:10 ;
Friction = (f_vk0 + mu_k * sigma1) / (1 + mu_k * 2 * Forhold) ;
Tension_failure = f_bt / 2.3 * sqrt(1 + sigma2/f_bt) ;
Compression_failure = (f_k – sigma3) * 1/Forhold*(1/2) ;
Friction2 = (f_vk0 + mu_k * sigma1) / (1 + mu_k * 2 * Forhold2) ;
Tension_failure = f_bt / 2.3 * sqrt(1 + sigma2/f_bt) ;
Compression_failure2 = (f_k – sigma23) * 1/Forhold2*(1/2) ;
Plotter forskydningsbæreevnerne
hf = figure() ;
hold on
plot(sigma1, Friction,’–‘,’Color’,[0.4660 0.6740 0.1880],’LineWidth’,1.3)
plot(sigma2, Tension_failure,’–‘,’Color’,[0.9290 0.6940 0.1250],’LineWidth’,1.3)
plot(sigma3, Compression_failure,’–‘,’Color’,[0.4940 0.1840 0.5560],’LineWidth’,1.3)
plot(sigma1, Friction2,’LineWidth’,1.3)
plot(sigma2, Tension_failure,’Color’,[0.6350 0.0780 0.1840],’LineWidth’,1.3)
plot(sigma23, Compression_failure2,’Color’,[0.8500 0.3250 0.0980],’LineWidth’,1.3)
% Shade the area between [sigma1, Friction] and [sigma1, Friction2]
% fill([sigma1, fliplr(sigma1)], [Friction, fliplr(Friction2)], [0.7 0.7 0.7], ‘EdgeColor’, ‘none’);
grid on;
xlim([0 12])
ylim([0 2])
% Shade the area between [sigma1, Friction] and [sigma1, Friction2]
[x0,y0,~,~] = intersections(sigma1,Friction,sigma2, Tension_failure);
ind = (sigma1<x0);
sigma1b = [sigma1(ind) x0]; % add x0 of true intersection point
Frictionp = [Friction(ind) y0]; % add y0 of true intersection point
[x1,y1,~,~] = intersections(sigma1,Friction2,sigma2, Tension_failure);
ind = (sigma1<x1);
sigma1c = [sigma1(ind) x1]; % add x1 of true intersection point
Friction2p = [Friction2(ind) y1]; % add y1 of true intersection point
% fill([sigma1, fliplr(sigma1)], [Friction, fliplr(Friction2)], [0.7 0.7 0.7], ‘EdgeColor’, ‘none’);
tt = fill([sigma1b, fliplr(sigma1c)], [Frictionp, fliplr(Friction2p)], [0.6350 0.0780 0.1840],’FaceAlpha’,0.0,’EdgeColor’, ‘none’);
hatchfill2(tt,’single’,’HatchAngle’,-45,’HatchDensity’,90,’HatchColor’,[0.6350 0.0780 0.1840],’HatchLineWidth’,1)
% Shade the area between [sigma3, Compression_failure] and [sigma3, Compression_failure2 ]
[x01,y01,~,~] = intersections(sigma3, Compression_failure,sigma2,Tension_failure);
ind = (sigma3>x01);
sigma1b = [x01 sigma3(ind)]; % add x0 of true intersection point
Frictionp = [y01 Compression_failure(ind)]; % add y0 of true intersection point
[x11,y11,~,~] = intersections(sigma23, Compression_failure2,sigma2,Tension_failure);
ind = (sigma23>x11);
sigma1c = [x11 sigma23(ind)]; % add x1 of true intersection point
Friction2p = [y11 Compression_failure2(ind)]; % add y1 of true intersection point
% fill([sigma1, fliplr(sigma1)], [Friction, fliplr(Friction2)], [0.7 0.7 0.7], ‘EdgeColor’, ‘none’);
tt2 = fill([sigma1b, fliplr(sigma1c)], [Frictionp, fliplr(Friction2p)], [0.6350 0.0780 0.1840], ‘EdgeColor’, ‘none’,’FaceAlpha’,0.0);
hatchfill2(tt2,’single’,’HatchAngle’,-45,’HatchDensity’,90,’HatchColor’,[0.6350 0.0780 0.1840],’HatchLineWidth’,1)
hax = gca;
hax.XDir = ‘reverse’; % flip axis direction
hax.YAxisLocation = ‘right’; % move ticks & labels to the other side
xlim([-2 12])
ylim([-0.5 2])
ha.Parent = hf.CurrentAxes; % associate annotation with current axes
% now you can use data units
ha.X = [-1.5 11];
ha.Y = [0 0] ;
%Define the variable
xac = -2; %x arrow coordinate
yac = 0; %y arrow coordinate
xas = 12; %x arrow shift
yas = 0; %y arrow shift
ha = annotation(‘arrow’);
ha.Parent = hf.CurrentAxes; % associate annotation with current axes
% now you can use data units
ha.X = [-1.5 11];
ha.Y = [0 0] ;
ha = annotation(‘arrow’);
ha.Parent = hf.CurrentAxes; % associate annotation with current axes
% now you can use data units
ha.X = [0 0];
ha.Y = [-0.4 2] ;
% remove old box and axes
box on
set(gca,’YColor’,get(gca,’Color’))
set(gca,’XColor’,get(gca,’Color’))
set(gca, ‘FontName’, ‘Times New Roman’, ‘FontSize’, 14)
set(gca, ‘XTickLabel’, {});
set(gca, ‘YTickLabel’, {});
legend({‘Friction failure (M&M)’,’Tension failure (M&M)’,’Compression failure (M&M)’,’Friction failure (DK)’,’Tension failure (DK)’,’Compression failure (DK)’},’Location’,’northeast’,’NumColumns’,1,’Orientation’,’vertical’)The arrowhead is pointing the wrong way in the x-axis. See figure below.
Definerer alle landes forskydningsbæreevne
clc; clear; close all; clc ;
Forhold = 1/2 ;
Forhold2 = 54/228;
f_vk0 = 0.4 ; % Klæbningsbidrag [MPa]
mu_k = 0.65 ; % Friktionskoefficient
f_bt = 1.00 ; % Trækstyrke af sten [MPa]
f_k = 10.00 ; % Trykstyrke af sten [MPa]
sigma1 = -0.0:0.1:1.6 ;
sigma2 = 0.1:0.1:10.2;
sigma3 = 8.3:0.1:10 ;
sigma23 = 9.1:0.1:10 ;
Friction = (f_vk0 + mu_k * sigma1) / (1 + mu_k * 2 * Forhold) ;
Tension_failure = f_bt / 2.3 * sqrt(1 + sigma2/f_bt) ;
Compression_failure = (f_k – sigma3) * 1/Forhold*(1/2) ;
Friction2 = (f_vk0 + mu_k * sigma1) / (1 + mu_k * 2 * Forhold2) ;
Tension_failure = f_bt / 2.3 * sqrt(1 + sigma2/f_bt) ;
Compression_failure2 = (f_k – sigma23) * 1/Forhold2*(1/2) ;
Plotter forskydningsbæreevnerne
hf = figure() ;
hold on
plot(sigma1, Friction,’–‘,’Color’,[0.4660 0.6740 0.1880],’LineWidth’,1.3)
plot(sigma2, Tension_failure,’–‘,’Color’,[0.9290 0.6940 0.1250],’LineWidth’,1.3)
plot(sigma3, Compression_failure,’–‘,’Color’,[0.4940 0.1840 0.5560],’LineWidth’,1.3)
plot(sigma1, Friction2,’LineWidth’,1.3)
plot(sigma2, Tension_failure,’Color’,[0.6350 0.0780 0.1840],’LineWidth’,1.3)
plot(sigma23, Compression_failure2,’Color’,[0.8500 0.3250 0.0980],’LineWidth’,1.3)
% Shade the area between [sigma1, Friction] and [sigma1, Friction2]
% fill([sigma1, fliplr(sigma1)], [Friction, fliplr(Friction2)], [0.7 0.7 0.7], ‘EdgeColor’, ‘none’);
grid on;
xlim([0 12])
ylim([0 2])
% Shade the area between [sigma1, Friction] and [sigma1, Friction2]
[x0,y0,~,~] = intersections(sigma1,Friction,sigma2, Tension_failure);
ind = (sigma1<x0);
sigma1b = [sigma1(ind) x0]; % add x0 of true intersection point
Frictionp = [Friction(ind) y0]; % add y0 of true intersection point
[x1,y1,~,~] = intersections(sigma1,Friction2,sigma2, Tension_failure);
ind = (sigma1<x1);
sigma1c = [sigma1(ind) x1]; % add x1 of true intersection point
Friction2p = [Friction2(ind) y1]; % add y1 of true intersection point
% fill([sigma1, fliplr(sigma1)], [Friction, fliplr(Friction2)], [0.7 0.7 0.7], ‘EdgeColor’, ‘none’);
tt = fill([sigma1b, fliplr(sigma1c)], [Frictionp, fliplr(Friction2p)], [0.6350 0.0780 0.1840],’FaceAlpha’,0.0,’EdgeColor’, ‘none’);
hatchfill2(tt,’single’,’HatchAngle’,-45,’HatchDensity’,90,’HatchColor’,[0.6350 0.0780 0.1840],’HatchLineWidth’,1)
% Shade the area between [sigma3, Compression_failure] and [sigma3, Compression_failure2 ]
[x01,y01,~,~] = intersections(sigma3, Compression_failure,sigma2,Tension_failure);
ind = (sigma3>x01);
sigma1b = [x01 sigma3(ind)]; % add x0 of true intersection point
Frictionp = [y01 Compression_failure(ind)]; % add y0 of true intersection point
[x11,y11,~,~] = intersections(sigma23, Compression_failure2,sigma2,Tension_failure);
ind = (sigma23>x11);
sigma1c = [x11 sigma23(ind)]; % add x1 of true intersection point
Friction2p = [y11 Compression_failure2(ind)]; % add y1 of true intersection point
% fill([sigma1, fliplr(sigma1)], [Friction, fliplr(Friction2)], [0.7 0.7 0.7], ‘EdgeColor’, ‘none’);
tt2 = fill([sigma1b, fliplr(sigma1c)], [Frictionp, fliplr(Friction2p)], [0.6350 0.0780 0.1840], ‘EdgeColor’, ‘none’,’FaceAlpha’,0.0);
hatchfill2(tt2,’single’,’HatchAngle’,-45,’HatchDensity’,90,’HatchColor’,[0.6350 0.0780 0.1840],’HatchLineWidth’,1)
hax = gca;
hax.XDir = ‘reverse’; % flip axis direction
hax.YAxisLocation = ‘right’; % move ticks & labels to the other side
xlim([-2 12])
ylim([-0.5 2])
ha.Parent = hf.CurrentAxes; % associate annotation with current axes
% now you can use data units
ha.X = [-1.5 11];
ha.Y = [0 0] ;
%Define the variable
xac = -2; %x arrow coordinate
yac = 0; %y arrow coordinate
xas = 12; %x arrow shift
yas = 0; %y arrow shift
ha = annotation(‘arrow’);
ha.Parent = hf.CurrentAxes; % associate annotation with current axes
% now you can use data units
ha.X = [-1.5 11];
ha.Y = [0 0] ;
ha = annotation(‘arrow’);
ha.Parent = hf.CurrentAxes; % associate annotation with current axes
% now you can use data units
ha.X = [0 0];
ha.Y = [-0.4 2] ;
% remove old box and axes
box on
set(gca,’YColor’,get(gca,’Color’))
set(gca,’XColor’,get(gca,’Color’))
set(gca, ‘FontName’, ‘Times New Roman’, ‘FontSize’, 14)
set(gca, ‘XTickLabel’, {});
set(gca, ‘YTickLabel’, {});
legend({‘Friction failure (M&M)’,’Tension failure (M&M)’,’Compression failure (M&M)’,’Friction failure (DK)’,’Tension failure (DK)’,’Compression failure (DK)’},’Location’,’northeast’,’NumColumns’,1,’Orientation’,’vertical’) The arrowhead is pointing the wrong way in the x-axis. See figure below.
Definerer alle landes forskydningsbæreevne
clc; clear; close all; clc ;
Forhold = 1/2 ;
Forhold2 = 54/228;
f_vk0 = 0.4 ; % Klæbningsbidrag [MPa]
mu_k = 0.65 ; % Friktionskoefficient
f_bt = 1.00 ; % Trækstyrke af sten [MPa]
f_k = 10.00 ; % Trykstyrke af sten [MPa]
sigma1 = -0.0:0.1:1.6 ;
sigma2 = 0.1:0.1:10.2;
sigma3 = 8.3:0.1:10 ;
sigma23 = 9.1:0.1:10 ;
Friction = (f_vk0 + mu_k * sigma1) / (1 + mu_k * 2 * Forhold) ;
Tension_failure = f_bt / 2.3 * sqrt(1 + sigma2/f_bt) ;
Compression_failure = (f_k – sigma3) * 1/Forhold*(1/2) ;
Friction2 = (f_vk0 + mu_k * sigma1) / (1 + mu_k * 2 * Forhold2) ;
Tension_failure = f_bt / 2.3 * sqrt(1 + sigma2/f_bt) ;
Compression_failure2 = (f_k – sigma23) * 1/Forhold2*(1/2) ;
Plotter forskydningsbæreevnerne
hf = figure() ;
hold on
plot(sigma1, Friction,’–‘,’Color’,[0.4660 0.6740 0.1880],’LineWidth’,1.3)
plot(sigma2, Tension_failure,’–‘,’Color’,[0.9290 0.6940 0.1250],’LineWidth’,1.3)
plot(sigma3, Compression_failure,’–‘,’Color’,[0.4940 0.1840 0.5560],’LineWidth’,1.3)
plot(sigma1, Friction2,’LineWidth’,1.3)
plot(sigma2, Tension_failure,’Color’,[0.6350 0.0780 0.1840],’LineWidth’,1.3)
plot(sigma23, Compression_failure2,’Color’,[0.8500 0.3250 0.0980],’LineWidth’,1.3)
% Shade the area between [sigma1, Friction] and [sigma1, Friction2]
% fill([sigma1, fliplr(sigma1)], [Friction, fliplr(Friction2)], [0.7 0.7 0.7], ‘EdgeColor’, ‘none’);
grid on;
xlim([0 12])
ylim([0 2])
% Shade the area between [sigma1, Friction] and [sigma1, Friction2]
[x0,y0,~,~] = intersections(sigma1,Friction,sigma2, Tension_failure);
ind = (sigma1<x0);
sigma1b = [sigma1(ind) x0]; % add x0 of true intersection point
Frictionp = [Friction(ind) y0]; % add y0 of true intersection point
[x1,y1,~,~] = intersections(sigma1,Friction2,sigma2, Tension_failure);
ind = (sigma1<x1);
sigma1c = [sigma1(ind) x1]; % add x1 of true intersection point
Friction2p = [Friction2(ind) y1]; % add y1 of true intersection point
% fill([sigma1, fliplr(sigma1)], [Friction, fliplr(Friction2)], [0.7 0.7 0.7], ‘EdgeColor’, ‘none’);
tt = fill([sigma1b, fliplr(sigma1c)], [Frictionp, fliplr(Friction2p)], [0.6350 0.0780 0.1840],’FaceAlpha’,0.0,’EdgeColor’, ‘none’);
hatchfill2(tt,’single’,’HatchAngle’,-45,’HatchDensity’,90,’HatchColor’,[0.6350 0.0780 0.1840],’HatchLineWidth’,1)
% Shade the area between [sigma3, Compression_failure] and [sigma3, Compression_failure2 ]
[x01,y01,~,~] = intersections(sigma3, Compression_failure,sigma2,Tension_failure);
ind = (sigma3>x01);
sigma1b = [x01 sigma3(ind)]; % add x0 of true intersection point
Frictionp = [y01 Compression_failure(ind)]; % add y0 of true intersection point
[x11,y11,~,~] = intersections(sigma23, Compression_failure2,sigma2,Tension_failure);
ind = (sigma23>x11);
sigma1c = [x11 sigma23(ind)]; % add x1 of true intersection point
Friction2p = [y11 Compression_failure2(ind)]; % add y1 of true intersection point
% fill([sigma1, fliplr(sigma1)], [Friction, fliplr(Friction2)], [0.7 0.7 0.7], ‘EdgeColor’, ‘none’);
tt2 = fill([sigma1b, fliplr(sigma1c)], [Frictionp, fliplr(Friction2p)], [0.6350 0.0780 0.1840], ‘EdgeColor’, ‘none’,’FaceAlpha’,0.0);
hatchfill2(tt2,’single’,’HatchAngle’,-45,’HatchDensity’,90,’HatchColor’,[0.6350 0.0780 0.1840],’HatchLineWidth’,1)
hax = gca;
hax.XDir = ‘reverse’; % flip axis direction
hax.YAxisLocation = ‘right’; % move ticks & labels to the other side
xlim([-2 12])
ylim([-0.5 2])
ha.Parent = hf.CurrentAxes; % associate annotation with current axes
% now you can use data units
ha.X = [-1.5 11];
ha.Y = [0 0] ;
%Define the variable
xac = -2; %x arrow coordinate
yac = 0; %y arrow coordinate
xas = 12; %x arrow shift
yas = 0; %y arrow shift
ha = annotation(‘arrow’);
ha.Parent = hf.CurrentAxes; % associate annotation with current axes
% now you can use data units
ha.X = [-1.5 11];
ha.Y = [0 0] ;
ha = annotation(‘arrow’);
ha.Parent = hf.CurrentAxes; % associate annotation with current axes
% now you can use data units
ha.X = [0 0];
ha.Y = [-0.4 2] ;
% remove old box and axes
box on
set(gca,’YColor’,get(gca,’Color’))
set(gca,’XColor’,get(gca,’Color’))
set(gca, ‘FontName’, ‘Times New Roman’, ‘FontSize’, 14)
set(gca, ‘XTickLabel’, {});
set(gca, ‘YTickLabel’, {});
legend({‘Friction failure (M&M)’,’Tension failure (M&M)’,’Compression failure (M&M)’,’Friction failure (DK)’,’Tension failure (DK)’,’Compression failure (DK)’},’Location’,’northeast’,’NumColumns’,1,’Orientation’,’vertical’) annotation(‘arrow’), ‘reverse’ MATLAB Answers — New Questions
Workspace sorting order of new desktop
Hello. Lately I’ve been trying the new feature "new desktop" for version 2024a which introduced the dark theme. I am really enjoying it, however I am going through an issue which is quite critical for my work.
With earlier versions, sorting variables in the workspace always prioritized alphabetical order, sorting by the first letter of the variable name regardless if it was uppercase or lower (e.g. the variables were sorted as a… – A… – b… – B…).
In the "new desktop" mode (not sure if it’s actually introduced entirely in 2024a [edit: I checked this and it does not happen in standard 2024a]), the sorting appears to be different, prioritizing the capitalized letter and only after sorting by the lowercase letters (so A… – B… – a… – b…).
This is actually a huge dealbreaker for me, as my work is strongly related to the old feature and I cannot simply adapt to it. I tried to look into the preferences but I couldn’t manage to find an option to bring back the legacy feature. Is there a way to go back to the previous workspace sorting order? It would be a shame to downgrade to the previous Matlab release since I’m enjoying the new one, but I’ll be forced to do it if I can’t solve this issue. Thank you.Hello. Lately I’ve been trying the new feature "new desktop" for version 2024a which introduced the dark theme. I am really enjoying it, however I am going through an issue which is quite critical for my work.
With earlier versions, sorting variables in the workspace always prioritized alphabetical order, sorting by the first letter of the variable name regardless if it was uppercase or lower (e.g. the variables were sorted as a… – A… – b… – B…).
In the "new desktop" mode (not sure if it’s actually introduced entirely in 2024a [edit: I checked this and it does not happen in standard 2024a]), the sorting appears to be different, prioritizing the capitalized letter and only after sorting by the lowercase letters (so A… – B… – a… – b…).
This is actually a huge dealbreaker for me, as my work is strongly related to the old feature and I cannot simply adapt to it. I tried to look into the preferences but I couldn’t manage to find an option to bring back the legacy feature. Is there a way to go back to the previous workspace sorting order? It would be a shame to downgrade to the previous Matlab release since I’m enjoying the new one, but I’ll be forced to do it if I can’t solve this issue. Thank you. Hello. Lately I’ve been trying the new feature "new desktop" for version 2024a which introduced the dark theme. I am really enjoying it, however I am going through an issue which is quite critical for my work.
With earlier versions, sorting variables in the workspace always prioritized alphabetical order, sorting by the first letter of the variable name regardless if it was uppercase or lower (e.g. the variables were sorted as a… – A… – b… – B…).
In the "new desktop" mode (not sure if it’s actually introduced entirely in 2024a [edit: I checked this and it does not happen in standard 2024a]), the sorting appears to be different, prioritizing the capitalized letter and only after sorting by the lowercase letters (so A… – B… – a… – b…).
This is actually a huge dealbreaker for me, as my work is strongly related to the old feature and I cannot simply adapt to it. I tried to look into the preferences but I couldn’t manage to find an option to bring back the legacy feature. Is there a way to go back to the previous workspace sorting order? It would be a shame to downgrade to the previous Matlab release since I’m enjoying the new one, but I’ll be forced to do it if I can’t solve this issue. Thank you. workspace, variables, sort MATLAB Answers — New Questions
Contour plot from x and y data points with corresponding contour level
I have sets of x and y data points that correspond to a specific contour level. For example (x1,y1) and (x2,y2) correspond to a contour level of 0.1 and (x3,y3) and (x4,y4) correspond to a contour level of 0.01. How do I plot these using the contour function?
In the attached .mat file, I have a cell array of tables. Each table has x and y data and the corresponding contour level (which is labeled Density). Basically, if you plot the x and y data using plot() it will create the contour, but I want to use contour() to plot to leverage labeling contours.I have sets of x and y data points that correspond to a specific contour level. For example (x1,y1) and (x2,y2) correspond to a contour level of 0.1 and (x3,y3) and (x4,y4) correspond to a contour level of 0.01. How do I plot these using the contour function?
In the attached .mat file, I have a cell array of tables. Each table has x and y data and the corresponding contour level (which is labeled Density). Basically, if you plot the x and y data using plot() it will create the contour, but I want to use contour() to plot to leverage labeling contours. I have sets of x and y data points that correspond to a specific contour level. For example (x1,y1) and (x2,y2) correspond to a contour level of 0.1 and (x3,y3) and (x4,y4) correspond to a contour level of 0.01. How do I plot these using the contour function?
In the attached .mat file, I have a cell array of tables. Each table has x and y data and the corresponding contour level (which is labeled Density). Basically, if you plot the x and y data using plot() it will create the contour, but I want to use contour() to plot to leverage labeling contours. contour, contour plot MATLAB Answers — New Questions
how to calling out the data in the matrix
i want to calling out the data in the matrix. for example;
t=[1 2 3; 4 5 6; 7 8 9]
what coding can be used to calling out the specific data like calling 3 in the t matrix.i want to calling out the data in the matrix. for example;
t=[1 2 3; 4 5 6; 7 8 9]
what coding can be used to calling out the specific data like calling 3 in the t matrix. i want to calling out the data in the matrix. for example;
t=[1 2 3; 4 5 6; 7 8 9]
what coding can be used to calling out the specific data like calling 3 in the t matrix. ??? MATLAB Answers — New Questions