How do I separate data I have Input into Matlab

1 回表示 (過去 30 日間)
Ethan Koproski
Ethan Koproski 2018 年 2 月 28 日
コメント済み: Ethan Koproski 2018 年 2 月 28 日
filename2 = 'DATA-001.CSV'; data2 = importdata(filename2); time2 = data2.data(:,1)*1/Fs; acc_z2 = data2.data(:,4);
I have a graph below. I need to separate the three distinct data sets/lines and get an average value for each section. Any idea how to do this

採用された回答

jonas
jonas 2018 年 2 月 28 日
A simple solution would be to define the time-points between which you want to calculate the mean, and then use logical indexing. For example:
t1=0;t2=0.6;
FirstAvg=mean(acc_z2(time2>t1 & time2<t2))
If you want a more general solution you could write something to find the abrupt changes. If you have the signal processing toolbox you could use the function called findchangepts
  1 件のコメント
Ethan Koproski
Ethan Koproski 2018 年 2 月 28 日
Thank You. This really helped.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by