Plotting the integral of a graph using cumtrapz.
16 ビュー (過去 30 日間)
古いコメントを表示
Hi I'm very new to MATLAB. I am trying to calculate the integral of a plot from my accelerometer data over time to find the graph of velocity over time, and after using cumtrapz it seems data is getting lost or maybe I didn't set it up right. In this case I sampled 2000 points of data from accelerometer but when plotting the integral over X, it only plots the first handful of datapoints instead of all 2000 points. What am I doing wrong here? Also if someone can help me to figure out how to plot the data over actual time in second elapsed (after starting the loop or fisrt data sample), I will greatly appriciate it.
2 件のコメント
Torsten
2023 年 6 月 3 日
If you set xlim([0.4 60.4]) as you do, you shouldn't wonder that MATLAB only plots up to a1(a) = 60.4 and not till 2000.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!