How can I plot in specific intervals?

22 ビュー (過去 30 日間)
Benjamin F
Benjamin F 2020 年 3 月 10 日
コメント済み: Cameron B 2020 年 3 月 11 日
So I have data taken over 4 days where every 100 points, the test is re-run to see how the character of the line changes over time. The data in the beginning and end of each individual 100 point interval is pretty messy, so I want to find a way to plot the data (currently in a 131000x2 table in the Workspace) starting at points 20 and ending at 80. Essentially, out of every 100 data points, I only want to graph points 20-80. Can anyone help me figure this out? I imagine it would use some kind of "for" loop, but I'm pretty new at this so I don't really know for sure.
Thanks!!

回答 (1 件)

Cameron B
Cameron B 2020 年 3 月 10 日
hold on
for ii = 1:100:size(YourArray,1)-100
plot(YourArray(ii+19,1), YourArray(ii+19,2)
end
hold off
  3 件のコメント
Benjamin F
Benjamin F 2020 年 3 月 11 日
Any thoughts?
Cameron B
Cameron B 2020 年 3 月 11 日
I don’t know what your data looks like. It looks like it’s in a table, but I’m not sure. You could use table2array(YourArray) to get the values in matrix form. If you post a couple lines of the data, it’ll be easier to diagnose.

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

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by