Borrar filtros
Borrar filtros

How remove plateaus on plot?

1 visualización (últimos 30 días)
Bruno
Bruno el 29 de En. de 2014
Comentada: Iain el 29 de En. de 2014
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

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 29 de En. de 2014
t=1:numel(y)
d=abs(gradient(y,t))
y(d<0.4)=[];
plot(y)

Más respuestas (1)

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

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by