Fill outliers without a loop for each rows

Hello everybody,
I have a matrix e.g 45500x24, and for each row, I would like to check the outliers and fill with the nearest non-outlier value.
Normally I have been doing,
for i=1:length(matrix)
matrix(i,:) = filloutliers(matrix(i,:),"nearest","median")
end
Not sure if it is the correct way but it surely takes so much time. Do you have any optimal way?

 Respuesta aceptada

David Hill
David Hill el 20 de Oct. de 2022
Try this:
matrix= filloutliers(matrix,'nearest','median',2);

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 20 de Oct. de 2022

Respondida:

el 20 de Oct. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by