How to integrate data points?

조회 수: 37 (최근 30일)
Mahmoud
Mahmoud 2015년 3월 13일
댓글: NUR AINA NAJIHA ABD MANAN 2020년 6월 22일
Hello guys, I have a set of 1220 points for acceleration vs time and I want to plot velocity vs time and displacement vs time. As you all know I should integrate acceleration in order to get the velocity, I was thinking about using the Trapezoidal rule however it will give me the total velocity but what I want is the velocity vs time (like point by point). Any idea how I can do that using Matlab? I don't want a Matlab ready function to do that. Like while or for loop are fine.
Thanks in advance
  댓글 수: 2
Abhishek Madan
Abhishek Madan 2020년 6월 10일
Hi ,
Can u please share the script which u used to solve this?
Thanks
NUR AINA NAJIHA ABD MANAN
NUR AINA NAJIHA ABD MANAN 2020년 6월 22일
yes .. please help me also, to convert accelerometer data to displacement

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

채택된 답변

Star Strider
Star Strider 2015년 3월 13일
Use the cumtrapz function.
For example:
a = acceleration_vector_from_file;
t = time_vector_from_file;
v = cumtrapz(t, a); % Velocity
c = cumtrapz(t, v); % Displacement

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by