필터 지우기
필터 지우기

How remove plateaus on plot?

조회 수: 1 (최근 30일)
Bruno
Bruno 2014년 1월 29일
댓글: Iain 2014년 1월 29일
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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 1월 29일
t=1:numel(y)
d=abs(gradient(y,t))
y(d<0.4)=[];
plot(y)

추가 답변 (1개)

Iain
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
Bruno
Bruno 2014년 1월 29일
Hi Iain, is not running
Error in ==> pl at 7 new_y = cumsum([initial diffs]);
Iain
Iain 2014년 1월 29일
My bad, I didn't correct for something I'd corrected for:
new_data = cumsum(diffs);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by