How can we plot the same time history plot two times but the second time with a time delay of 2 sec?
Mostra commenti meno recenti
How can we plot the same time history plot two times but the second time with a time delay of 2 sec?

Risposta accettata
Più risposte (1)
Eric Sofen
il 3 Nov 2025
0 voti
Without seeing your current code, it's hard to give a detailed response, but assuming your data is in a timetable, the lag function can be used to shift the time vector by either n timesteps or a time interval dt. Then you can plot that result the same way you're plotting your original dataset.
1 Commento
Walter Roberson
il 29 Nov 2025
lag inserts leading NaN and drops trailing entries. That is not what most people would mean by plotting something with a delay.
Categorie
Scopri di più su Matrices and Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
