Plotting points on a graph every 15 minutes
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am currently plotting points on a graph every hour which is within a while loop, but I am trying to adjust that so the points are plotted every 15 minutes.
This is what my original code looks like:
contraction(icount, 1)=newtime;
contraction(icount, 2)=radius;
icount = icount +1;
end
...
figure
plot(contraction(:,1),contraction(:,2)/contraction(1,2),'-o');
axis([0 100 0 1]);
save data.mat contraction
The newtime is the hour time.
And so I tried multiple ways to adjust it to 15 minutes but none of them have worked. I was sure this following code would fix the problem but it still isn't working. Here is the code:
for(c=newtime:+0.025:newtime+1)
contraction(icount, 1)=c;
contraction(icount, 2)=radius;
end
contraction(icount, 1)=newtime;
contraction(icount, 2)=radius;
icount = icount +1;
end
...
figure
plot(contraction(:,1),contraction(:,2)/contraction(1,2),'-o');
axis([0 100 0 1]);
save data.mat contraction
Can anyone help me solve this?
0 Kommentare
Antworten (1)
Sulaymon Eshkabilov
am 13 Jul. 2021
You had better use timer class:
https://www.mathworks.com/help/matlab/ref/timer-class.html
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!