Tag Archives: matlab
Combining structs into one struct.
Hello, I have several structs that I would like to combine together into one. The issue I find is that the data for some reasons gets completely jumbled. Each time the file runs, the columns from one struct become a part of another and I cannot figure out why
CombineGLMParam(‘2_2_2’, ‘2_3_2′,’2’)
CombineGLMParam(0, ‘2_5_1′,’2’)
function CombineGLMParam(bat1,bat2,bat)
%Combine GLM parameters by putting in the bat and the file. If bat1 is not 0, open the bat1 file and create a file GLM bat.
% If it is 0, open the GLM Bat file and append the bat 2 file to GLM.
if bat1~=0
b1=load([dirf,’Bat_’,bat1,’_GLM_Params.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);
b1=struct2cell(b1)
b2=struct2cell(b2)
else
b1=load([dirf,’GLM_’,bat,’.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);
b1=struct2cell(b1.b4)
b2=struct2cell(b2)
end
for n=1:size(b2,1)
b3{n}=[b1{n}’ b2{n}’]’;
end
Header={‘ThetaX’, ‘ThetaY’, ‘ThetaZ’, ‘Td’, ‘Vd’, ‘Vw’, ‘Hd’, ‘Hw’, ‘Ld’,’Lw’};
b4=cell2struct(b3, Header, 2)
save([dirf,’GLM_’,bat,’.mat’], ‘b4’)Hello, I have several structs that I would like to combine together into one. The issue I find is that the data for some reasons gets completely jumbled. Each time the file runs, the columns from one struct become a part of another and I cannot figure out why
CombineGLMParam(‘2_2_2’, ‘2_3_2′,’2’)
CombineGLMParam(0, ‘2_5_1′,’2’)
function CombineGLMParam(bat1,bat2,bat)
%Combine GLM parameters by putting in the bat and the file. If bat1 is not 0, open the bat1 file and create a file GLM bat.
% If it is 0, open the GLM Bat file and append the bat 2 file to GLM.
if bat1~=0
b1=load([dirf,’Bat_’,bat1,’_GLM_Params.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);
b1=struct2cell(b1)
b2=struct2cell(b2)
else
b1=load([dirf,’GLM_’,bat,’.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);
b1=struct2cell(b1.b4)
b2=struct2cell(b2)
end
for n=1:size(b2,1)
b3{n}=[b1{n}’ b2{n}’]’;
end
Header={‘ThetaX’, ‘ThetaY’, ‘ThetaZ’, ‘Td’, ‘Vd’, ‘Vw’, ‘Hd’, ‘Hw’, ‘Ld’,’Lw’};
b4=cell2struct(b3, Header, 2)
save([dirf,’GLM_’,bat,’.mat’], ‘b4’) Hello, I have several structs that I would like to combine together into one. The issue I find is that the data for some reasons gets completely jumbled. Each time the file runs, the columns from one struct become a part of another and I cannot figure out why
CombineGLMParam(‘2_2_2’, ‘2_3_2′,’2’)
CombineGLMParam(0, ‘2_5_1′,’2’)
function CombineGLMParam(bat1,bat2,bat)
%Combine GLM parameters by putting in the bat and the file. If bat1 is not 0, open the bat1 file and create a file GLM bat.
% If it is 0, open the GLM Bat file and append the bat 2 file to GLM.
if bat1~=0
b1=load([dirf,’Bat_’,bat1,’_GLM_Params.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);
b1=struct2cell(b1)
b2=struct2cell(b2)
else
b1=load([dirf,’GLM_’,bat,’.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);
b1=struct2cell(b1.b4)
b2=struct2cell(b2)
end
for n=1:size(b2,1)
b3{n}=[b1{n}’ b2{n}’]’;
end
Header={‘ThetaX’, ‘ThetaY’, ‘ThetaZ’, ‘Td’, ‘Vd’, ‘Vw’, ‘Hd’, ‘Hw’, ‘Ld’,’Lw’};
b4=cell2struct(b3, Header, 2)
save([dirf,’GLM_’,bat,’.mat’], ‘b4’) struct, structure MATLAB Answers — New Questions
How to set Simulink block parameters using an absolute model path
I am calling a simulink model out of a MATLAB script, but this model is located in a different directory (not in the working directory).
This model can be executed by using the "sim" command in combination with the absolute path, e.g:
sim("C:UsersMATLABmyModel.slx")
Now I want to change the parameter of a "Contant" block when calling the simulation.
The functions "set_param" seems only to work with a model handle which was created by a model being in the current working path.
% name of model
mdl = "myMdl";
% name of the block
blk = "myConstBlk";
% Serch path
path = strcat(mdl, "/", blk);
% set parameter of Const
set_param(path, "Value", "5");
When performing the same action, but with an absolute path, this is not working anymore.
% name of model
mdl = "C:UsersMATLABmyModel.slx";
% name of the block
blk = "myConstBlk";
% Serch path
path = strcat(mdl, "/", blk);
% set parameter of Const
set_param(path, "Value", "5");
Invalid Simulink object name: ‘C:UsersMATLABmyMdl.slx/myConstBlk’.
Even if the model is loaded by:
h = load_system(mdl); %mdl is the absolute path
the handel "h" could not be used in the set_param function.
So therefore the qustion:
How to perform all the task provided by "set_param" and "get_param" using a model which shall be referenced by an absolute path?I am calling a simulink model out of a MATLAB script, but this model is located in a different directory (not in the working directory).
This model can be executed by using the "sim" command in combination with the absolute path, e.g:
sim("C:UsersMATLABmyModel.slx")
Now I want to change the parameter of a "Contant" block when calling the simulation.
The functions "set_param" seems only to work with a model handle which was created by a model being in the current working path.
% name of model
mdl = "myMdl";
% name of the block
blk = "myConstBlk";
% Serch path
path = strcat(mdl, "/", blk);
% set parameter of Const
set_param(path, "Value", "5");
When performing the same action, but with an absolute path, this is not working anymore.
% name of model
mdl = "C:UsersMATLABmyModel.slx";
% name of the block
blk = "myConstBlk";
% Serch path
path = strcat(mdl, "/", blk);
% set parameter of Const
set_param(path, "Value", "5");
Invalid Simulink object name: ‘C:UsersMATLABmyMdl.slx/myConstBlk’.
Even if the model is loaded by:
h = load_system(mdl); %mdl is the absolute path
the handel "h" could not be used in the set_param function.
So therefore the qustion:
How to perform all the task provided by "set_param" and "get_param" using a model which shall be referenced by an absolute path? I am calling a simulink model out of a MATLAB script, but this model is located in a different directory (not in the working directory).
This model can be executed by using the "sim" command in combination with the absolute path, e.g:
sim("C:UsersMATLABmyModel.slx")
Now I want to change the parameter of a "Contant" block when calling the simulation.
The functions "set_param" seems only to work with a model handle which was created by a model being in the current working path.
% name of model
mdl = "myMdl";
% name of the block
blk = "myConstBlk";
% Serch path
path = strcat(mdl, "/", blk);
% set parameter of Const
set_param(path, "Value", "5");
When performing the same action, but with an absolute path, this is not working anymore.
% name of model
mdl = "C:UsersMATLABmyModel.slx";
% name of the block
blk = "myConstBlk";
% Serch path
path = strcat(mdl, "/", blk);
% set parameter of Const
set_param(path, "Value", "5");
Invalid Simulink object name: ‘C:UsersMATLABmyMdl.slx/myConstBlk’.
Even if the model is loaded by:
h = load_system(mdl); %mdl is the absolute path
the handel "h" could not be used in the set_param function.
So therefore the qustion:
How to perform all the task provided by "set_param" and "get_param" using a model which shall be referenced by an absolute path? absolute path, simulink, set block parameter MATLAB Answers — New Questions
Can I use knobs to control several elements from the same injected struct?
I am accessing an injected struct that has several elements I want to use individual knobs to control through a mask but I am not seeing the elements when I try to connect the knobs to the constant block. Can anyone assist me?I am accessing an injected struct that has several elements I want to use individual knobs to control through a mask but I am not seeing the elements when I try to connect the knobs to the constant block. Can anyone assist me? I am accessing an injected struct that has several elements I want to use individual knobs to control through a mask but I am not seeing the elements when I try to connect the knobs to the constant block. Can anyone assist me? knob, struct, injected, mask MATLAB Answers — New Questions
Monte Carlo integration (hit or miss) to find the area of a circle of radius R
Hi everyone. Trying to solve an old exam topic regarding Monte Carlo integration, I wrote the following code for which I based it on a code from a professor in the C language. For R = 1 it worked so I assume I did it correctly. Then I tried R > 1 and the results were wrong compared to the formula πR^2 so I tried a few modifications by trial and error method. I fixed the problem and it seems to works correctly but there is a modification that I don’t understand. If you could help me understand this it would be great. Thank you in advance.
clear, clc, format short
%———- Computation for R = 1 ———-
R = 1;
N = 100000;
insideCircle = 0;
for i = 1:N
x = rand(1);
y = rand(1);
if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end
Area_MC = 4*insideCircle/N;
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;
fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error);
%———- Computation for R > 1 (e.g. R = 4 but you can try any real value) ———-
R = 4;
N = 100000;
insideCircle = 0;
for i = 1:N
x = rand(1)*R;
y = rand(1)*R;
if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end
Area_MC = 4*R^3*insideCircle/N; % Modification needed that I don’t understand (I had to multiply with R^3)
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;
fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error);Hi everyone. Trying to solve an old exam topic regarding Monte Carlo integration, I wrote the following code for which I based it on a code from a professor in the C language. For R = 1 it worked so I assume I did it correctly. Then I tried R > 1 and the results were wrong compared to the formula πR^2 so I tried a few modifications by trial and error method. I fixed the problem and it seems to works correctly but there is a modification that I don’t understand. If you could help me understand this it would be great. Thank you in advance.
clear, clc, format short
%———- Computation for R = 1 ———-
R = 1;
N = 100000;
insideCircle = 0;
for i = 1:N
x = rand(1);
y = rand(1);
if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end
Area_MC = 4*insideCircle/N;
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;
fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error);
%———- Computation for R > 1 (e.g. R = 4 but you can try any real value) ———-
R = 4;
N = 100000;
insideCircle = 0;
for i = 1:N
x = rand(1)*R;
y = rand(1)*R;
if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end
Area_MC = 4*R^3*insideCircle/N; % Modification needed that I don’t understand (I had to multiply with R^3)
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;
fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error); Hi everyone. Trying to solve an old exam topic regarding Monte Carlo integration, I wrote the following code for which I based it on a code from a professor in the C language. For R = 1 it worked so I assume I did it correctly. Then I tried R > 1 and the results were wrong compared to the formula πR^2 so I tried a few modifications by trial and error method. I fixed the problem and it seems to works correctly but there is a modification that I don’t understand. If you could help me understand this it would be great. Thank you in advance.
clear, clc, format short
%———- Computation for R = 1 ———-
R = 1;
N = 100000;
insideCircle = 0;
for i = 1:N
x = rand(1);
y = rand(1);
if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end
Area_MC = 4*insideCircle/N;
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;
fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error);
%———- Computation for R > 1 (e.g. R = 4 but you can try any real value) ———-
R = 4;
N = 100000;
insideCircle = 0;
for i = 1:N
x = rand(1)*R;
y = rand(1)*R;
if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end
Area_MC = 4*R^3*insideCircle/N; % Modification needed that I don’t understand (I had to multiply with R^3)
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;
fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error); monte carlo integration, hit or miss, area of a cirlcle MATLAB Answers — New Questions
Understanding basics of struct?
Hello,
A beginners short story with 3 and a half Questions:
I want to get a list of all filepath of filenames in a folder (?).
For that I’m using dir which creates a struct (so far so good).
Now I want to save the first colum with the filenames as a cell array (?)
Solved this by using struct2cell .
But is there a way to export a single colum (or even a defined range of that colum) ?
I was also thinking an easy for loop would solve that but…
I’m struggeling to get the length of the struct ?
And…
Is there an elegant way to sort names in the struct in a "natural way" (1,2,3,…,11,12 instead of 1,11,12,2,3,…) ?
Big Thanks!!!Hello,
A beginners short story with 3 and a half Questions:
I want to get a list of all filepath of filenames in a folder (?).
For that I’m using dir which creates a struct (so far so good).
Now I want to save the first colum with the filenames as a cell array (?)
Solved this by using struct2cell .
But is there a way to export a single colum (or even a defined range of that colum) ?
I was also thinking an easy for loop would solve that but…
I’m struggeling to get the length of the struct ?
And…
Is there an elegant way to sort names in the struct in a "natural way" (1,2,3,…,11,12 instead of 1,11,12,2,3,…) ?
Big Thanks!!! Hello,
A beginners short story with 3 and a half Questions:
I want to get a list of all filepath of filenames in a folder (?).
For that I’m using dir which creates a struct (so far so good).
Now I want to save the first colum with the filenames as a cell array (?)
Solved this by using struct2cell .
But is there a way to export a single colum (or even a defined range of that colum) ?
I was also thinking an easy for loop would solve that but…
I’m struggeling to get the length of the struct ?
And…
Is there an elegant way to sort names in the struct in a "natural way" (1,2,3,…,11,12 instead of 1,11,12,2,3,…) ?
Big Thanks!!! struct, filepath, struct2cell, struct length, struct sort, basics MATLAB Answers — New Questions
Mathlab Code for summation equation
Hi all,
How can I write matlab code for summation equation for the file attached.
Pls help.
Thank you guys..Hi all,
How can I write matlab code for summation equation for the file attached.
Pls help.
Thank you guys.. Hi all,
How can I write matlab code for summation equation for the file attached.
Pls help.
Thank you guys.. summation MATLAB Answers — New Questions
How do I write a .mat file (exported from the Design Data in an .sldd file) to a csv file?
I am trying to write the contents of a .mat file to a csv file. The .mat file was generated by exporting the Design Data from a simulink data dictionary file that is used in a Simulink model. I’ve tried to research how to extract the data from the .mat but haven’t been able to find anything significant. If you have any suggestions for strategies or functions I could use, please add a comment. Thanks.
CODE:
FileData = load(‘SLDD_220817.mat’);
NewData=struct2cell(FileData);
csvwrite(‘SLDD_220817.csv’, NewData);
CW OUTPUT:
Error using csvwrite (line 47)
The input cell array cannot be converted to a matrix.
Error in sldd_to_csv (line 11)
csvwrite(‘SLDD_220817.csv’, NewData);I am trying to write the contents of a .mat file to a csv file. The .mat file was generated by exporting the Design Data from a simulink data dictionary file that is used in a Simulink model. I’ve tried to research how to extract the data from the .mat but haven’t been able to find anything significant. If you have any suggestions for strategies or functions I could use, please add a comment. Thanks.
CODE:
FileData = load(‘SLDD_220817.mat’);
NewData=struct2cell(FileData);
csvwrite(‘SLDD_220817.csv’, NewData);
CW OUTPUT:
Error using csvwrite (line 47)
The input cell array cannot be converted to a matrix.
Error in sldd_to_csv (line 11)
csvwrite(‘SLDD_220817.csv’, NewData); I am trying to write the contents of a .mat file to a csv file. The .mat file was generated by exporting the Design Data from a simulink data dictionary file that is used in a Simulink model. I’ve tried to research how to extract the data from the .mat but haven’t been able to find anything significant. If you have any suggestions for strategies or functions I could use, please add a comment. Thanks.
CODE:
FileData = load(‘SLDD_220817.mat’);
NewData=struct2cell(FileData);
csvwrite(‘SLDD_220817.csv’, NewData);
CW OUTPUT:
Error using csvwrite (line 47)
The input cell array cannot be converted to a matrix.
Error in sldd_to_csv (line 11)
csvwrite(‘SLDD_220817.csv’, NewData); sldd, csvwrite MATLAB Answers — New Questions
how to changes for two parameters values in simulink block at same time in matlab 2022. this function is already founded in matlab 2016
Freq=0;F=0; n=0;A=0;
for k=1:20 Freq=Freq+50; n=n+1;
sim(‘Rc_model22’);
if k==1 t=Vcamp(:,1);Vcamp1(:,1)=Vcamp(:,2); AVc1(:,1)=AVc(:,2); end;
if k==2 Vcamp2(:,1)=Vcamp(:,2); AVc2(:,1)=AVc(:,2);end;
if k==3 Vcamp3(:,1)=Vcamp(:,2); AVc3(:,1)=AVc(:,2);end;
if k==4 Vcamp4(:,1)=Vcamp(:,2); AVc4(:,1)=AVc(:,2);end;
if k==5 Vcamp5(:,1)=Vcamp(:,2); AVc5(:,1)=AVc(:,2);end;
if k==6 Vcamp6(:,1)=Vcamp(:,2); AVc6(:,1)=AVc(:,2);end;
if k==7 Vcamp7(:,1)=Vcamp(:,2); AVc7(:,1)=AVc(:,2);end;
if k==8 Vcamp8(:,1)=Vcamp(:,2); AVc8(:,1)=AVc(:,2);end;
if k==9 Vcamp9(:,1)=Vcamp(:,2); AVc9(:,1)=AVc(:,2);end;
if k==10 Vcamp10(:,1)=Vcamp(:,2); AVc10(:,1)=AVc(:,2);end;
if k==11 Vcamp11(:,1)=Vcamp(:,2); AVc11(:,1)=AVc(:,2);end;
if k==12 Vcamp12(:,1)=Vcamp(:,2); AVc12(:,1)=AVc(:,2);end;
if k==13 Vcamp13(:,1)=Vcamp(:,2); AVc13(:,1)=AVc(:,2);end;
if k==14 Vcamp14(:,1)=Vcamp(:,2); AVc14(:,1)=AVc(:,2);end;
if k==15 Vcamp15(:,1)=Vcamp(:,2); AVc15(:,1)=AVc(:,2);end;
if k==16 Vcamp16(:,1)=Vcamp(:,2); AVc16(:,1)=AVc(:,2);end;
if k==17 Vcamp17(:,1)=Vcamp(:,2); AVc17(:,1)=AVc(:,2);end;
if k==18 Vcamp18(:,1)=Vcamp(:,2); AVc18(:,1)=AVc(:,2);end;
if k==19 Vcamp19(:,1)=Vcamp(:,2); AVc19(:,1)=AVc(:,2);end;
if k==20 Vcamp20(:,1)=Vcamp(:,2); AVc20(:,1)=AVc(:,2);end;
endFreq=0;F=0; n=0;A=0;
for k=1:20 Freq=Freq+50; n=n+1;
sim(‘Rc_model22’);
if k==1 t=Vcamp(:,1);Vcamp1(:,1)=Vcamp(:,2); AVc1(:,1)=AVc(:,2); end;
if k==2 Vcamp2(:,1)=Vcamp(:,2); AVc2(:,1)=AVc(:,2);end;
if k==3 Vcamp3(:,1)=Vcamp(:,2); AVc3(:,1)=AVc(:,2);end;
if k==4 Vcamp4(:,1)=Vcamp(:,2); AVc4(:,1)=AVc(:,2);end;
if k==5 Vcamp5(:,1)=Vcamp(:,2); AVc5(:,1)=AVc(:,2);end;
if k==6 Vcamp6(:,1)=Vcamp(:,2); AVc6(:,1)=AVc(:,2);end;
if k==7 Vcamp7(:,1)=Vcamp(:,2); AVc7(:,1)=AVc(:,2);end;
if k==8 Vcamp8(:,1)=Vcamp(:,2); AVc8(:,1)=AVc(:,2);end;
if k==9 Vcamp9(:,1)=Vcamp(:,2); AVc9(:,1)=AVc(:,2);end;
if k==10 Vcamp10(:,1)=Vcamp(:,2); AVc10(:,1)=AVc(:,2);end;
if k==11 Vcamp11(:,1)=Vcamp(:,2); AVc11(:,1)=AVc(:,2);end;
if k==12 Vcamp12(:,1)=Vcamp(:,2); AVc12(:,1)=AVc(:,2);end;
if k==13 Vcamp13(:,1)=Vcamp(:,2); AVc13(:,1)=AVc(:,2);end;
if k==14 Vcamp14(:,1)=Vcamp(:,2); AVc14(:,1)=AVc(:,2);end;
if k==15 Vcamp15(:,1)=Vcamp(:,2); AVc15(:,1)=AVc(:,2);end;
if k==16 Vcamp16(:,1)=Vcamp(:,2); AVc16(:,1)=AVc(:,2);end;
if k==17 Vcamp17(:,1)=Vcamp(:,2); AVc17(:,1)=AVc(:,2);end;
if k==18 Vcamp18(:,1)=Vcamp(:,2); AVc18(:,1)=AVc(:,2);end;
if k==19 Vcamp19(:,1)=Vcamp(:,2); AVc19(:,1)=AVc(:,2);end;
if k==20 Vcamp20(:,1)=Vcamp(:,2); AVc20(:,1)=AVc(:,2);end;
end Freq=0;F=0; n=0;A=0;
for k=1:20 Freq=Freq+50; n=n+1;
sim(‘Rc_model22’);
if k==1 t=Vcamp(:,1);Vcamp1(:,1)=Vcamp(:,2); AVc1(:,1)=AVc(:,2); end;
if k==2 Vcamp2(:,1)=Vcamp(:,2); AVc2(:,1)=AVc(:,2);end;
if k==3 Vcamp3(:,1)=Vcamp(:,2); AVc3(:,1)=AVc(:,2);end;
if k==4 Vcamp4(:,1)=Vcamp(:,2); AVc4(:,1)=AVc(:,2);end;
if k==5 Vcamp5(:,1)=Vcamp(:,2); AVc5(:,1)=AVc(:,2);end;
if k==6 Vcamp6(:,1)=Vcamp(:,2); AVc6(:,1)=AVc(:,2);end;
if k==7 Vcamp7(:,1)=Vcamp(:,2); AVc7(:,1)=AVc(:,2);end;
if k==8 Vcamp8(:,1)=Vcamp(:,2); AVc8(:,1)=AVc(:,2);end;
if k==9 Vcamp9(:,1)=Vcamp(:,2); AVc9(:,1)=AVc(:,2);end;
if k==10 Vcamp10(:,1)=Vcamp(:,2); AVc10(:,1)=AVc(:,2);end;
if k==11 Vcamp11(:,1)=Vcamp(:,2); AVc11(:,1)=AVc(:,2);end;
if k==12 Vcamp12(:,1)=Vcamp(:,2); AVc12(:,1)=AVc(:,2);end;
if k==13 Vcamp13(:,1)=Vcamp(:,2); AVc13(:,1)=AVc(:,2);end;
if k==14 Vcamp14(:,1)=Vcamp(:,2); AVc14(:,1)=AVc(:,2);end;
if k==15 Vcamp15(:,1)=Vcamp(:,2); AVc15(:,1)=AVc(:,2);end;
if k==16 Vcamp16(:,1)=Vcamp(:,2); AVc16(:,1)=AVc(:,2);end;
if k==17 Vcamp17(:,1)=Vcamp(:,2); AVc17(:,1)=AVc(:,2);end;
if k==18 Vcamp18(:,1)=Vcamp(:,2); AVc18(:,1)=AVc(:,2);end;
if k==19 Vcamp19(:,1)=Vcamp(:,2); AVc19(:,1)=AVc(:,2);end;
if k==20 Vcamp20(:,1)=Vcamp(:,2); AVc20(:,1)=AVc(:,2);end;
end how to changes for two parameters values in simuli MATLAB Answers — New Questions
How to sum the product between a matrix and 2 vectors
I need to solve a system of differential equation written as:
For each equation I should solve a summation like:
where K_Br is a matrix previously calculated and n is a vector as the solution of the differential equation system.
For example, for i=3:
I wrote the system of differential equation as:
function ndot = System_ni (t,n)
ndot = zeros(M,1);
ndot(1) = -n(1)*sum(K_Br(1,1:M)*n(1:M));
for i = 2:M
ndot(i) = 1/2*sum(K_Br(1:i-1,i-1:1)*n(i-1:1)*n(1:i-1))-n(i)*sum(K_Br(i,1:M)*n(1:M));
end
end
but summation seems not to work.
Thank you in advance for any help.I need to solve a system of differential equation written as:
For each equation I should solve a summation like:
where K_Br is a matrix previously calculated and n is a vector as the solution of the differential equation system.
For example, for i=3:
I wrote the system of differential equation as:
function ndot = System_ni (t,n)
ndot = zeros(M,1);
ndot(1) = -n(1)*sum(K_Br(1,1:M)*n(1:M));
for i = 2:M
ndot(i) = 1/2*sum(K_Br(1:i-1,i-1:1)*n(i-1:1)*n(1:i-1))-n(i)*sum(K_Br(i,1:M)*n(1:M));
end
end
but summation seems not to work.
Thank you in advance for any help. I need to solve a system of differential equation written as:
For each equation I should solve a summation like:
where K_Br is a matrix previously calculated and n is a vector as the solution of the differential equation system.
For example, for i=3:
I wrote the system of differential equation as:
function ndot = System_ni (t,n)
ndot = zeros(M,1);
ndot(1) = -n(1)*sum(K_Br(1,1:M)*n(1:M));
for i = 2:M
ndot(i) = 1/2*sum(K_Br(1:i-1,i-1:1)*n(i-1:1)*n(1:i-1))-n(i)*sum(K_Br(i,1:M)*n(1:M));
end
end
but summation seems not to work.
Thank you in advance for any help. summation, product, matrix vector product, differential equations MATLAB Answers — New Questions
The following code is correct?
I have a Ph of size 139 48 101 values ranging say 0 to 0.4, now to compute Kd from Ph have two equations if Ph is equal or less than 0.35 and if Ph is greater than 0.35. I used following code to apply two equation. Have I done it correctly?
Kd = zeros(size(Ph));
% Find indices where Ph is less than or equal to 0.35
indices1 = Ph <= 0.35;
% Find indices where Ph is greater than 0.35
indices2 = Ph > 0.35;
% Apply the first equation to ‘kd’ where PhiE is less than or equal to 0.35
Kd(indices1) = 38.18.*(1-3.39.*Ph(indices1)+1.95.*Ph(indices1).^2).*1e9;
% Apply the second equation to ‘kd’ where Ph is greater than 0.35
Kd(indices2) = exp(-62.60.*PhiE(indices2)+22.58).*1e9;I have a Ph of size 139 48 101 values ranging say 0 to 0.4, now to compute Kd from Ph have two equations if Ph is equal or less than 0.35 and if Ph is greater than 0.35. I used following code to apply two equation. Have I done it correctly?
Kd = zeros(size(Ph));
% Find indices where Ph is less than or equal to 0.35
indices1 = Ph <= 0.35;
% Find indices where Ph is greater than 0.35
indices2 = Ph > 0.35;
% Apply the first equation to ‘kd’ where PhiE is less than or equal to 0.35
Kd(indices1) = 38.18.*(1-3.39.*Ph(indices1)+1.95.*Ph(indices1).^2).*1e9;
% Apply the second equation to ‘kd’ where Ph is greater than 0.35
Kd(indices2) = exp(-62.60.*PhiE(indices2)+22.58).*1e9; I have a Ph of size 139 48 101 values ranging say 0 to 0.4, now to compute Kd from Ph have two equations if Ph is equal or less than 0.35 and if Ph is greater than 0.35. I used following code to apply two equation. Have I done it correctly?
Kd = zeros(size(Ph));
% Find indices where Ph is less than or equal to 0.35
indices1 = Ph <= 0.35;
% Find indices where Ph is greater than 0.35
indices2 = Ph > 0.35;
% Apply the first equation to ‘kd’ where PhiE is less than or equal to 0.35
Kd(indices1) = 38.18.*(1-3.39.*Ph(indices1)+1.95.*Ph(indices1).^2).*1e9;
% Apply the second equation to ‘kd’ where Ph is greater than 0.35
Kd(indices2) = exp(-62.60.*PhiE(indices2)+22.58).*1e9; indexing, if statement, code MATLAB Answers — New Questions
C2000 Delfino does not receive code when being powered externally
I am trying to make the LED on my F28379D blink as proof that I can flash code to the board. I have an old model in 2022a which has always compiled fine and works when being powered externally with all of the required hardware attached. I am migrating to 2024b and am trying to make the model run as such. When I power the delfino from the USB with nothing else attached it flashes fine and the LED blinks, when I take the exact same model and and run it on a board that is powered externally and has some other hardware attached (works for 2022a) simulink says that it copiles fine and uploads fine but doesn’t actually blink the led or run anything else.
Any help/ideas is greatly appreciated.I am trying to make the LED on my F28379D blink as proof that I can flash code to the board. I have an old model in 2022a which has always compiled fine and works when being powered externally with all of the required hardware attached. I am migrating to 2024b and am trying to make the model run as such. When I power the delfino from the USB with nothing else attached it flashes fine and the LED blinks, when I take the exact same model and and run it on a board that is powered externally and has some other hardware attached (works for 2022a) simulink says that it copiles fine and uploads fine but doesn’t actually blink the led or run anything else.
Any help/ideas is greatly appreciated. I am trying to make the LED on my F28379D blink as proof that I can flash code to the board. I have an old model in 2022a which has always compiled fine and works when being powered externally with all of the required hardware attached. I am migrating to 2024b and am trying to make the model run as such. When I power the delfino from the USB with nothing else attached it flashes fine and the LED blinks, when I take the exact same model and and run it on a board that is powered externally and has some other hardware attached (works for 2022a) simulink says that it copiles fine and uploads fine but doesn’t actually blink the led or run anything else.
Any help/ideas is greatly appreciated. simulink, c2000, microcontroller, delfino, f28379d MATLAB Answers — New Questions
Help with making an Ellipse Area function
I am having trouble making my ellipse function work. I am using X,Y data in the function although there is an error in the script that is not allowing me to find the area. Also I would love help on displaying the ellipse.
This is the code for my function.
function[area] = Ellipse_Area(FCOPX,FCOPY)
sFCOPX=FCOPX*1000;
sFCOPY=FCOPY*1000;
Sx = std(sFCOPX);
Sy = std(sFCOPY);
Syx = 0;
for i = 1:length(sFCOPX)
Syx = Syx + (sFCOPX(i) – mean(sFCOPY))*(sFCOPX(i) – mean(sFCOPX));
endI am having trouble making my ellipse function work. I am using X,Y data in the function although there is an error in the script that is not allowing me to find the area. Also I would love help on displaying the ellipse.
This is the code for my function.
function[area] = Ellipse_Area(FCOPX,FCOPY)
sFCOPX=FCOPX*1000;
sFCOPY=FCOPY*1000;
Sx = std(sFCOPX);
Sy = std(sFCOPY);
Syx = 0;
for i = 1:length(sFCOPX)
Syx = Syx + (sFCOPX(i) – mean(sFCOPY))*(sFCOPX(i) – mean(sFCOPX));
end I am having trouble making my ellipse function work. I am using X,Y data in the function although there is an error in the script that is not allowing me to find the area. Also I would love help on displaying the ellipse.
This is the code for my function.
function[area] = Ellipse_Area(FCOPX,FCOPY)
sFCOPX=FCOPX*1000;
sFCOPY=FCOPY*1000;
Sx = std(sFCOPX);
Sy = std(sFCOPY);
Syx = 0;
for i = 1:length(sFCOPX)
Syx = Syx + (sFCOPX(i) – mean(sFCOPY))*(sFCOPX(i) – mean(sFCOPX));
end ellipse area, ellipse, area MATLAB Answers — New Questions
Viewing Live Script in viewer.mathworks.com
Hi –
I am the steward for some open source projects, and we want to be able to include links to view the output of Matlab Live Scripts on the web.
There are several links like this on the File Exchange, for example one such link from https://www.mathworks.com/matlabcentral/fileexchange/134991-deepinterpolation-matlab is:
https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fwww.mathworks.com%2Fmatlabcentral%2Fmlc-downloads%2Fdownloads%2F84c22101-bffc-435a-910c-b0c7dcd5b386%2F4dd1b338-1032-45d1-b894-d1779b6d28f2%2Ffiles%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web
The trouble is that this links to a specific file in a specific version, and I’d like to be able to grab a Live Script from GitHub so that as the script is updated on GitHub, the viewing link always points to the latest version. Right now, I’d have to know the encoded path in FileExchange that will be generated when it updates the File Exchange version from GitHub.
But I don’t seem to be able to get the viewer to read from GitHub. It is possible that I have a path error here but I have redone this a couple times and I always see "We’re sorry, but something went wrong". So perhaps it’s not legal to pull scripts from other places?
https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fgithub.com%2FMATLAB-Community-Toolboxes-at-INCF%2FDeepInterpolation-MATLAB%2Fraw%2Fmain%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web
The broader issue is, is there any recommended way to keep a link to the "current" version instead of to a specific version?
Thanks
SteveHi –
I am the steward for some open source projects, and we want to be able to include links to view the output of Matlab Live Scripts on the web.
There are several links like this on the File Exchange, for example one such link from https://www.mathworks.com/matlabcentral/fileexchange/134991-deepinterpolation-matlab is:
https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fwww.mathworks.com%2Fmatlabcentral%2Fmlc-downloads%2Fdownloads%2F84c22101-bffc-435a-910c-b0c7dcd5b386%2F4dd1b338-1032-45d1-b894-d1779b6d28f2%2Ffiles%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web
The trouble is that this links to a specific file in a specific version, and I’d like to be able to grab a Live Script from GitHub so that as the script is updated on GitHub, the viewing link always points to the latest version. Right now, I’d have to know the encoded path in FileExchange that will be generated when it updates the File Exchange version from GitHub.
But I don’t seem to be able to get the viewer to read from GitHub. It is possible that I have a path error here but I have redone this a couple times and I always see "We’re sorry, but something went wrong". So perhaps it’s not legal to pull scripts from other places?
https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fgithub.com%2FMATLAB-Community-Toolboxes-at-INCF%2FDeepInterpolation-MATLAB%2Fraw%2Fmain%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web
The broader issue is, is there any recommended way to keep a link to the "current" version instead of to a specific version?
Thanks
Steve Hi –
I am the steward for some open source projects, and we want to be able to include links to view the output of Matlab Live Scripts on the web.
There are several links like this on the File Exchange, for example one such link from https://www.mathworks.com/matlabcentral/fileexchange/134991-deepinterpolation-matlab is:
https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fwww.mathworks.com%2Fmatlabcentral%2Fmlc-downloads%2Fdownloads%2F84c22101-bffc-435a-910c-b0c7dcd5b386%2F4dd1b338-1032-45d1-b894-d1779b6d28f2%2Ffiles%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web
The trouble is that this links to a specific file in a specific version, and I’d like to be able to grab a Live Script from GitHub so that as the script is updated on GitHub, the viewing link always points to the latest version. Right now, I’d have to know the encoded path in FileExchange that will be generated when it updates the File Exchange version from GitHub.
But I don’t seem to be able to get the viewer to read from GitHub. It is possible that I have a path error here but I have redone this a couple times and I always see "We’re sorry, but something went wrong". So perhaps it’s not legal to pull scripts from other places?
https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fgithub.com%2FMATLAB-Community-Toolboxes-at-INCF%2FDeepInterpolation-MATLAB%2Fraw%2Fmain%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web
The broader issue is, is there any recommended way to keep a link to the "current" version instead of to a specific version?
Thanks
Steve viewer.mathworks.com, community toolbox documentation MATLAB Answers — New Questions
Phase error between two signals ?
Hello,
i have two inputs
V1=A1sin(wt)
and
V2=A2cos(wt+theta)
knowing that A1 is diffrent to A2 … i want to find Theta how can i do that in simulink ? thanks in advanceHello,
i have two inputs
V1=A1sin(wt)
and
V2=A2cos(wt+theta)
knowing that A1 is diffrent to A2 … i want to find Theta how can i do that in simulink ? thanks in advance Hello,
i have two inputs
V1=A1sin(wt)
and
V2=A2cos(wt+theta)
knowing that A1 is diffrent to A2 … i want to find Theta how can i do that in simulink ? thanks in advance phase error, two signals, simulink MATLAB Answers — New Questions
design repeated measurements model
Hi,
I’ve a table
t =
Group day1_1 day1_2 day2_1 day2_2
_________ ______ ______ ______ ______
‘Placebo’ 12.023 12.719 12.11 12.554
‘Placebo’ 11.806 12.186 12.788 12.164
‘Control’ 11.763 12.008 11.481 13.325
‘Placebo’ 11.703 11.678 12.073 12.234
‘Control’ 11.558 12.696 13.692 12.732
‘Placebo’ 13.633 13.253 11.347 12.432
‘Placebo’ 12.374 12.41 11.49 11.457
‘Placebo’ 11.476 11.564 12.542 11.112
‘Control’ 12.496 10.661 12.199 12.382
‘Placebo’ 12.659 12.863 11.844 11.799
‘Control’ 11.611 11.447 12.838 12.592
‘Placebo’ 12.524 13.7 11.772 11.387
where each row is a individual. individuals are tested on two following days with the same test (before and after). on the second day group Placebo is treated with a plecabo between measurement 1 and 2. We’re seeking for differences placebo vs control that only appear on day two.
here is the rest of my code:
Win = [1 2 1 3];
rm = fitrm(t,’day1_1-day2_2 ~ Group’,’WithinDesign’,Win);
tbl = ranova(rm);
is this correct? Probably not.
Edit:
still struggling with that. And we added ‘sex’ and ‘age’ to our data. Any comment/help welcome !
Thanks
DomHi,
I’ve a table
t =
Group day1_1 day1_2 day2_1 day2_2
_________ ______ ______ ______ ______
‘Placebo’ 12.023 12.719 12.11 12.554
‘Placebo’ 11.806 12.186 12.788 12.164
‘Control’ 11.763 12.008 11.481 13.325
‘Placebo’ 11.703 11.678 12.073 12.234
‘Control’ 11.558 12.696 13.692 12.732
‘Placebo’ 13.633 13.253 11.347 12.432
‘Placebo’ 12.374 12.41 11.49 11.457
‘Placebo’ 11.476 11.564 12.542 11.112
‘Control’ 12.496 10.661 12.199 12.382
‘Placebo’ 12.659 12.863 11.844 11.799
‘Control’ 11.611 11.447 12.838 12.592
‘Placebo’ 12.524 13.7 11.772 11.387
where each row is a individual. individuals are tested on two following days with the same test (before and after). on the second day group Placebo is treated with a plecabo between measurement 1 and 2. We’re seeking for differences placebo vs control that only appear on day two.
here is the rest of my code:
Win = [1 2 1 3];
rm = fitrm(t,’day1_1-day2_2 ~ Group’,’WithinDesign’,Win);
tbl = ranova(rm);
is this correct? Probably not.
Edit:
still struggling with that. And we added ‘sex’ and ‘age’ to our data. Any comment/help welcome !
Thanks
Dom Hi,
I’ve a table
t =
Group day1_1 day1_2 day2_1 day2_2
_________ ______ ______ ______ ______
‘Placebo’ 12.023 12.719 12.11 12.554
‘Placebo’ 11.806 12.186 12.788 12.164
‘Control’ 11.763 12.008 11.481 13.325
‘Placebo’ 11.703 11.678 12.073 12.234
‘Control’ 11.558 12.696 13.692 12.732
‘Placebo’ 13.633 13.253 11.347 12.432
‘Placebo’ 12.374 12.41 11.49 11.457
‘Placebo’ 11.476 11.564 12.542 11.112
‘Control’ 12.496 10.661 12.199 12.382
‘Placebo’ 12.659 12.863 11.844 11.799
‘Control’ 11.611 11.447 12.838 12.592
‘Placebo’ 12.524 13.7 11.772 11.387
where each row is a individual. individuals are tested on two following days with the same test (before and after). on the second day group Placebo is treated with a plecabo between measurement 1 and 2. We’re seeking for differences placebo vs control that only appear on day two.
here is the rest of my code:
Win = [1 2 1 3];
rm = fitrm(t,’day1_1-day2_2 ~ Group’,’WithinDesign’,Win);
tbl = ranova(rm);
is this correct? Probably not.
Edit:
still struggling with that. And we added ‘sex’ and ‘age’ to our data. Any comment/help welcome !
Thanks
Dom fitrm, repeated measurments, ranova, withindesign MATLAB Answers — New Questions
Reducing a dataset’s dimensions with PCA and projecting it onto a graph.
Hi all,
Like the title says, I’d like to take a large dataset X of m by n size and reduce it’s dimensions to m by 2 length, and from there project it onto a 2D plane where the axis are the two main principal components of X. Is the below code enough, or have I missed a step?
[a,b] = pca(X);
b = b’;
plot(b(1,:),b(2,:),’.’);
From what I understand, taking the two columns of b gives me the two principal components that tell us the most about X’s structure, whilst having reduced it’s dimensions down. I’m basing this on the <http://www.nlpca.org/pca-principal-component-analysis-matlab.html code I found here,> but I just wanted to check I had it correct.Hi all,
Like the title says, I’d like to take a large dataset X of m by n size and reduce it’s dimensions to m by 2 length, and from there project it onto a 2D plane where the axis are the two main principal components of X. Is the below code enough, or have I missed a step?
[a,b] = pca(X);
b = b’;
plot(b(1,:),b(2,:),’.’);
From what I understand, taking the two columns of b gives me the two principal components that tell us the most about X’s structure, whilst having reduced it’s dimensions down. I’m basing this on the <http://www.nlpca.org/pca-principal-component-analysis-matlab.html code I found here,> but I just wanted to check I had it correct. Hi all,
Like the title says, I’d like to take a large dataset X of m by n size and reduce it’s dimensions to m by 2 length, and from there project it onto a 2D plane where the axis are the two main principal components of X. Is the below code enough, or have I missed a step?
[a,b] = pca(X);
b = b’;
plot(b(1,:),b(2,:),’.’);
From what I understand, taking the two columns of b gives me the two principal components that tell us the most about X’s structure, whilst having reduced it’s dimensions down. I’m basing this on the <http://www.nlpca.org/pca-principal-component-analysis-matlab.html code I found here,> but I just wanted to check I had it correct. pca, matlab, dimension reduction, datasets, data handling MATLAB Answers — New Questions
Inputs for chi-squared test
Hi.
I would like to test the hypothesis that the answers I got in a questionnaire from two differently sized patient groups have the same mean. The answers can be ‘1’,’2′,’3′,’4′ or ‘5’. I was thinking of performing a chi-squared test, but am not familiar with the Statistics Toolbox and therefore cannot understand how to format my data as suitable inputs for chi2gof, crosstabs or any other of the Matlab functions that performs chi2 tests. Can you help?
Many thanks. Best wishes,
MartaHi.
I would like to test the hypothesis that the answers I got in a questionnaire from two differently sized patient groups have the same mean. The answers can be ‘1’,’2′,’3′,’4′ or ‘5’. I was thinking of performing a chi-squared test, but am not familiar with the Statistics Toolbox and therefore cannot understand how to format my data as suitable inputs for chi2gof, crosstabs or any other of the Matlab functions that performs chi2 tests. Can you help?
Many thanks. Best wishes,
Marta Hi.
I would like to test the hypothesis that the answers I got in a questionnaire from two differently sized patient groups have the same mean. The answers can be ‘1’,’2′,’3′,’4′ or ‘5’. I was thinking of performing a chi-squared test, but am not familiar with the Statistics Toolbox and therefore cannot understand how to format my data as suitable inputs for chi2gof, crosstabs or any other of the Matlab functions that performs chi2 tests. Can you help?
Many thanks. Best wishes,
Marta chi-squared, statistics, hypothesis tests, categorical variables MATLAB Answers — New Questions
I’m trying to plot a mat file with a 1×1 structure, but it’s giving the error that “Index in position 2 exceeds array bounds. Index must not exceed 1.”
data1 = load(‘radial.mat’); % Assume data is [X1 Y1] for file1
plot(data1(:,1), data1(:,2), ‘g’, ‘DisplayName’, ‘File 2’);
rhis is what is in the file
data: [-0.0128 -0.0130 -0.0129 -0.0127 -0.0122 -0.0116 … ]
the data is a 1×22620 double
datastart: 1
dataend: 22620
titles: ‘Channel 1’
rangemin: -2
rangemax: 2
unittext: ‘V’
unittextmap: 1
blocktimes: 7.3965e+05
tickrate: 1000
samplerate: 1000
firstsampleoffset: 0
comtext: ”
com: [0×5 double]data1 = load(‘radial.mat’); % Assume data is [X1 Y1] for file1
plot(data1(:,1), data1(:,2), ‘g’, ‘DisplayName’, ‘File 2’);
rhis is what is in the file
data: [-0.0128 -0.0130 -0.0129 -0.0127 -0.0122 -0.0116 … ]
the data is a 1×22620 double
datastart: 1
dataend: 22620
titles: ‘Channel 1’
rangemin: -2
rangemax: 2
unittext: ‘V’
unittextmap: 1
blocktimes: 7.3965e+05
tickrate: 1000
samplerate: 1000
firstsampleoffset: 0
comtext: ”
com: [0×5 double] data1 = load(‘radial.mat’); % Assume data is [X1 Y1] for file1
plot(data1(:,1), data1(:,2), ‘g’, ‘DisplayName’, ‘File 2’);
rhis is what is in the file
data: [-0.0128 -0.0130 -0.0129 -0.0127 -0.0122 -0.0116 … ]
the data is a 1×22620 double
datastart: 1
dataend: 22620
titles: ‘Channel 1’
rangemin: -2
rangemax: 2
unittext: ‘V’
unittextmap: 1
blocktimes: 7.3965e+05
tickrate: 1000
samplerate: 1000
firstsampleoffset: 0
comtext: ”
com: [0×5 double] matlab function MATLAB Answers — New Questions
How can I calculate a mean of a signal or a mean of a part of a signal on Simulink ?
Hello everyone,
Will you help me to calculate a *mean of a signal (mean of a part of a signal)* on *Simulink* ?
I tried with the block " *mean*" but I always find the same input signal. I want a *value* ( *the mean value of the signal*).
thank you in advanceHello everyone,
Will you help me to calculate a *mean of a signal (mean of a part of a signal)* on *Simulink* ?
I tried with the block " *mean*" but I always find the same input signal. I want a *value* ( *the mean value of the signal*).
thank you in advance Hello everyone,
Will you help me to calculate a *mean of a signal (mean of a part of a signal)* on *Simulink* ?
I tried with the block " *mean*" but I always find the same input signal. I want a *value* ( *the mean value of the signal*).
thank you in advance simulink, mean, matlab MATLAB Answers — New Questions
Data not displaying on graph (field chart 1 and field chart 2)
Project to code and monitor 2 co2 sensor and to display it on to a LCD as well as connecting it to thinkspeak to display readings on to the field chart 1 and 2.
When i ran my code it shows Data sent to thinkspeak etc but when i go to thinkspeak it does not display it on the field chart 1 and 2 however there is entires and i can also export the data that i have recorded on my sensors.
What may be the issue i hope to get some help thanks.
Channel ID to public: 2816578Project to code and monitor 2 co2 sensor and to display it on to a LCD as well as connecting it to thinkspeak to display readings on to the field chart 1 and 2.
When i ran my code it shows Data sent to thinkspeak etc but when i go to thinkspeak it does not display it on the field chart 1 and 2 however there is entires and i can also export the data that i have recorded on my sensors.
What may be the issue i hope to get some help thanks.
Channel ID to public: 2816578 Project to code and monitor 2 co2 sensor and to display it on to a LCD as well as connecting it to thinkspeak to display readings on to the field chart 1 and 2.
When i ran my code it shows Data sent to thinkspeak etc but when i go to thinkspeak it does not display it on the field chart 1 and 2 however there is entires and i can also export the data that i have recorded on my sensors.
What may be the issue i hope to get some help thanks.
Channel ID to public: 2816578 python, display, problem MATLAB Answers — New Questions