How remove plateaus on plot?
1 回表示 (過去 30 日間)
古いコメントを表示
I want create a script that remove the plateau in red on the plot (figure) and concatenate the rest of the data. I have large data set. Thanks
0 件のコメント
採用された回答
その他の回答 (1 件)
Iain
2014 年 1 月 29 日
I can't download your example, but the answer shouldn't be too difficult:
data %- This is your vector of values.
initial = data(1);
diffs = diff(data);
diffs(diffs==0) = [];
diffs(2:end+1) = diffs;
diffs(1) = initial;
new_data = cumsum([initial diffs]);
plot(new_data)
2 件のコメント
Iain
2014 年 1 月 29 日
My bad, I didn't correct for something I'd corrected for:
new_data = cumsum(diffs);
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!