How to keep all runs in one file or save it somewhere else to plot it later

조회 수: 2 (최근 30일)
I have to run 5 samples at different step time and plot h vs t
example : steptime = 1 for the first run for i = 0:steptime:10 ...... formula to calculate h and t
and plot h vs t
then let steptime = 2 for second run .
...... plot h vs t ..
is there a way to keep all this data in the same file to plot all of them in the same graph or how to save each data in separate folder and combine all in one. When I save my data it is under .mat type and my operation on the computer is Linux .
Thanks
  댓글 수: 1
Phong Pham
Phong Pham 2012년 2월 3일
I just plot(t,h) for single data and I dont know how to plot all at once because every time I change the steptime the h and t are different with previous run

댓글을 달려면 로그인하십시오.

채택된 답변

Friedrich
Friedrich 2012년 2월 3일
Hi,
are you looking for hold on and hold off?
>> plot(1:10)
>> hold on
>> plot(rand(5))
>> hold off
  댓글 수: 3
Friedrich
Friedrich 2012년 2월 3일
I am not sure if I understand it correctly. I assume you do something like this:
count = 0;
for i=1:1:10
count = count + 1;
t(count) = i;
h(count) = i*t(count)^2 + i
end
plot(t,h)
hold on
t = []
h = []
count = 0;
for i=1:2:10
count = count + 1;
t(count) = i^2;
h(count) = i*sqrt(t(count)) + i
end
plot(t,h)
Phong Pham
Phong Pham 2012년 2월 3일
Is there a way to write the loop for the whole code with steptime change and plot all of them at the same time

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by