Integrating velocity data with cumtrapz()

조회 수: 10 (최근 30일)
Fabian Gock
Fabian Gock 2018년 6월 19일
답변: Fabian Gock 2018년 6월 19일
Hi,
I have a quite long vector with the longitudinal velocity data of a car. As it only drives forward, there are no negative values. However, when I integrate the vector using cumtrapz() the calculated data which are supposed to be the traveled distance, are also decreasing and even becoming negative.
Used Timestamps for cumtrapz are 0:0.01:59.53 The velocity vector is attached.
Thanks in advance! -Fabian
  댓글 수: 1
Adam
Adam 2018년 6월 19일
편집: Adam 2018년 6월 19일
Seems to work fine for me:
x = 0:0.01:59.53;
Q = cumtrapz( x, chassis_velocity_longitudinal );
figure; plot( x, Q )

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

답변 (1개)

Fabian Gock
Fabian Gock 2018년 6월 19일
Oh god, I accidentally switched time and velocity.. Sorry for this embarrassing question and thanks for the quick help!
Kind regards -Fabian

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Parrot Drones에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by