I am working with GUIDE to make a big GUI. I would like to plot two sets of data on the same plot. For regular MATLAB code I would write:
time = 1:10;
data1= (1:10).*2;
data2= (1:10).*3;
figure;
plot(t,data1);
hold on;
plot(t,data2);
hold off;
However, this does not work with the GUI system. With the GUI I am typing:
time = 1:10;
data1= (1:10).*2;
data2= (1:10).*3;
plot(handles.axes1,t,data1);
hold on;
plot(handles.axes1,t,data2);
hold off;
But this does not work. data2 just over writes the previous plot. Any help would be appreciated. Thank you.
SOLUTION:
time = 1:10;
data1= (1:10).*2;
data2= (1:10).*3;
plot(handles.axes1,x,y);
hold(handles.axes1)
plot(handles.axes1,x,z);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…