How do I plot velocity after differentiating displacement with respect to time?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Matthew Roper
am 1 Feb. 2017
Beantwortet: Star Strider
am 1 Feb. 2017
I have successfully managed to differentiate displacement to find velocity. However, i am then unable to plot a figure of velocity versus time, or differentiate again to find acceleration, as the vectors are of different sizes.
How can I fix this?
Thanks.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 1 Feb. 2017
use the gradient function for the numerical derivative, not diff. (Use del2/4 for the second derivative.) The diff function does successive differences, so the output is one element shorter than the input. The gradient function is a numerical derivative function, so the output will be the same length as the input. See the documentation for the various functions for details.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differential Equations 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!