how to add timestep iteration and show all iteration in plot
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Abdulrahman Mohamed
am 8 Feb. 2022
Kommentiert: Benjamin Thompson
am 10 Feb. 2022
Alteration
0 Kommentare
Akzeptierte Antwort
Benjamin Thompson
am 8 Feb. 2022
You can use a for loop, using your t0, dt, and tf variables in a vector notation to define the values of the time variable t:
for t = t0:dt:tf
your code...
end
1 Kommentar
Benjamin Thompson
am 10 Feb. 2022
If this question has been answered, please mark it accepted. Users with a higher acceptance rate will get faster and more effective responses for future answers.
Weitere Antworten (1)
Arif Hoq
am 8 Feb. 2022
time = [4 50] ;
points = [20 100] ;
% interpolation
step_count = time(1):0.1:time(2) ; % timestep 0.1
expected_points = interp1(time,points,step_count) ;
% plot
plot(time,points,'*r',step_count,expected_points,'-g')
ylim([0 110])
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical 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!