Integrating Acceleration Data Matlab

14 ビュー (過去 30 日間)
Timo Mayer
Timo Mayer 2020 年 11 月 20 日
コメント済み: Timo Mayer 2020 年 11 月 20 日
Hi there,
I have the acceleration vs. time data that is attached. When I plot it, I get the following:
I want to integrate it to get the Velocity vs. Time graph but I do not know how to do this. I have tried trapz() but it only gives some weird linear graph.
If someone could let me know how to do this that would be greatly appreciated.
Cheers.

採用された回答

Alan Stevens
Alan Stevens 2020 年 11 月 20 日
Try
v = cumtrapz(X2(:,1),X2(:,2));
plot(X2(:,1),v)
  7 件のコメント
Alan Stevens
Alan Stevens 2020 年 11 月 20 日
Instead of
figure
plot(X2)
title('Acceleration (m/s^2) vs. Time (ms)')
xlabel('Time (ms)')
ylabel('Acceleration (m/s^2)')
use
figure
plot(t,accn)
title('Acceleration (m/s^2) vs. Time (ms)')
xlabel('Time (ms)')
ylabel('Acceleration (m/s^2)')
Similarly, I would use
plot(t,vel)
and
plot(t,dis)
for clarity.
Timo Mayer
Timo Mayer 2020 年 11 月 20 日
Great, thank you very much, now it looks much better!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by