Integrating velocity data with cumtrapz()

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일

1 개 추천

Oh god, I accidentally switched time and velocity.. Sorry for this embarrassing question and thanks for the quick help!
Kind regards -Fabian

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2018년 6월 19일

답변:

2018년 6월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by