Understanding using the Plot() and troubleshooting with R2024a
So I am doing a simple project coupling with Simulink and an Arduino Uno. I built a model and used the arduino to generate data.
This is the code that I am using.
figure; plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
eo_act and ei are variables.
Ts is the assigned Sample time which is declared in the program in Simulink.
40 is the amount of time the program ran to collect the data.
So my problem is this: I keep on having this error code. But I don’t know how to fix it or understand why it is popping up.
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,’r’);
and
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
I read the doc file assoiated with plots(), but it doesn’t seem to explain for my situation. I have been experimenting with it. I separated each variable in their own respective plot()s and added a "hold on". It still throws the same error. I also verified that the variable has data in them.So I am doing a simple project coupling with Simulink and an Arduino Uno. I built a model and used the arduino to generate data.
This is the code that I am using.
figure; plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
eo_act and ei are variables.
Ts is the assigned Sample time which is declared in the program in Simulink.
40 is the amount of time the program ran to collect the data.
So my problem is this: I keep on having this error code. But I don’t know how to fix it or understand why it is popping up.
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,’r’);
and
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
I read the doc file assoiated with plots(), but it doesn’t seem to explain for my situation. I have been experimenting with it. I separated each variable in their own respective plot()s and added a "hold on". It still throws the same error. I also verified that the variable has data in them. So I am doing a simple project coupling with Simulink and an Arduino Uno. I built a model and used the arduino to generate data.
This is the code that I am using.
figure; plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
eo_act and ei are variables.
Ts is the assigned Sample time which is declared in the program in Simulink.
40 is the amount of time the program ran to collect the data.
So my problem is this: I keep on having this error code. But I don’t know how to fix it or understand why it is popping up.
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,’r’);
and
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
I read the doc file assoiated with plots(), but it doesn’t seem to explain for my situation. I have been experimenting with it. I separated each variable in their own respective plot()s and added a "hold on". It still throws the same error. I also verified that the variable has data in them. plot MATLAB Answers — New Questions