Dear all,
I have a graph of the position of a body vs. time. It's actually two graphs. One for the x-position and one for the y-position.
I now need to plot the velocity of the body vs. time. It will be two graphs again. One for the velocity along the x direction and one for the velocity along the y-direction.
What would be the best way (i.e. the method that yields the most accurate result) to do this? Should I use diff() or gradient()? I would very much appreciate any advice. Thanks!

 채택된 답변

Star Strider
Star Strider 2015년 1월 22일

0 개 추천

I would use gradient for each x and y, and if it applies to your application, hypot, since that will give you the net position or velocity at each time if you need that.

댓글 수: 3

MeEngr
MeEngr 2015년 1월 22일
Thanks!!
Star Strider
Star Strider 2015년 1월 22일
My pleasure!
khaled elmoshrefy
khaled elmoshrefy 2020년 5월 14일
편집: khaled elmoshrefy 2020년 5월 14일
how can i implement that?

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

추가 답변 (0개)

카테고리

태그

질문:

2015년 1월 22일

편집:

2020년 5월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by