How to find points 3 std away from the mean in vector

Hello,
Could you please help me to find a way how to find the points which are 3 std away from the mean in vector?

 Respuesta aceptada

Image Analyst
Image Analyst el 9 de Sept. de 2014
Editada: Image Analyst el 9 de Sept. de 2014
Assuming you really mean " more than 3 standard deviations away from the mean"...
% Get the mean and standard deviation of the vector
theMean = mean(yourVector);
stdDev = std(yourVector);
% Get a logical vector of the locations where the value is more than 3 sd away from the mean.
locationsAwayFromMean = abs(yourVector - theMean) > stdDev;
% Extract only those elements
outlierValues = yourVector(locationsAwayFromMean);

4 comentarios

Olga's "Answer" moved here:
Thanks a lot! And how can i delete these outlierValues from myVector?
yourVector(locationsAwayFromMean) = []; % Remove/delete outlier locations.
Filippe Frulli
Filippe Frulli el 19 de Ag. de 2020
Editada: Filippe Frulli el 19 de Ag. de 2020
May I please ask how exactly is the 3*standard deviations calculated?
Based on my interpretation of Image Analyst's solution, I only see 1 standard deviation being calculated. I would really appreciate clarification.
Shouldn't it be
locationsAwayFromMean = abs(yourVector - theMean) > 3*stdDev?
Yes, sorry for the error and thanks for the clarification.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Control Design en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 9 de Sept. de 2014

Comentada:

el 19 de Ag. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by