Removing extreme values from a Matrix in MATLAB

会有一股神秘感。 提交于 2019-12-25 03:18:19

问题


I have a matrix with x-y data points:

A= [x1 , y1; x2 , y2; x3 , y3]

and i want to remove selected points (rows) that their y value is above some deviation from the average.

How can i do this ?

Thank you, Ron


回答1:


Here is what you seem to need:

A(abs(A(:,2)-mean(A(:,2)))>treshold,:) = []

If you want you can let the treshold be something like

1.234*std(A(:,2))



回答2:


A(A(:,2) > mean(A(:,2) + ScaleFactor*std(A(:,2)),:) = [];

ScaleFactor will depend on what your criteria is..



来源:https://stackoverflow.com/questions/25361871/removing-extreme-values-from-a-matrix-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!