How remove plateaus on plot?
3 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155781/image.jpeg)
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!