Borrar filtros
Borrar filtros

How to ignore value that is in vector when the box plot is used

1 visualización (últimos 30 días)
I calculated the median by box plot.
But I want to ignore some data that is in vector array to calculate that.
I have a 1x9 vector and reshape to 3x3 vector.
And getting median value by each colums.
But I want to ignore by position like [1x1],[2x3] these two positions.
So then the value of first column is considered only [5, 1] except [1x1]
and third column is considered only [ 3,6] exacept [2x3].
I can remove that position before reshape.
But if i do that, I can't get [3x3] vector. The value might be positioned wrong.
How to solve this?
A = ([1, 2, 3, 5, 3, 4, 1, 3, 6]);
A = reshape(A,[3,3]);
A = ([1, 2, 3],
[5, 3, 4],
[1, 3, 6]);
^ ^ ^
%I have to get the median value from each column after doing reshape.
for
A_ = median([ ]);
end
  2 comentarios
Walter Roberson
Walter Roberson el 29 de Dic. de 2018
The result of the call to median is a scalar . It does not make sense to ignore things indexed into a scalar .
Are you wanting to ignore input values?If so then ignore by position or ignore by value?
CHOI HYUNDUK
CHOI HYUNDUK el 30 de Dic. de 2018
I modified my question! could you checki it again?

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 29 de Dic. de 2018
let the numeric values be in VV
A = median( V(~ismember(V, [0,20])) )
  2 comentarios
CHOI HYUNDUK
CHOI HYUNDUK el 29 de Dic. de 2018
I edited my question a little bit. Coudl you give me that more detail?
Walter Roberson
Walter Roberson el 30 de Dic. de 2018
With newer releases,
T = reshame(A, 3, 3);
T(1,1) = nan; T(2,3) = nan; %set those positions to nan
A_ = median(T, 1, 'omitnan')

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by