问题
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