Hi I want to ask about divide data and take its median for example, a=[1:100] b=sqrt(a.*2);
I want to take the median of every 20 data. How should it be?

 Respuesta aceptada

Star Strider
Star Strider el 13 de Jul. de 2017
If you want to take the median of ‘b(1:20)’, ‘b(21:40)’..., this works:
med_b = median(reshape(b(:), 20, []));

Más respuestas (1)

Image Analyst
Image Analyst el 13 de Jul. de 2017

0 votos

To move continuously, use the built-in movmedian(). To move in jumps, use blockproc() in the Image Processing Toolbox.

Etiquetas

Preguntada:

el 13 de Jul. de 2017

Respondida:

el 13 de Jul. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by