How remove plateaus on plot?
Show older comments

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
Accepted Answer
More Answers (1)
Iain
on 29 Jan 2014
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)
Categories
Find more on Language Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!