Reputation: 1801
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
Upvotes: 0
Views: 1622
Reputation: 29064
A(A(:,2) > mean(A(:,2) + ScaleFactor*std(A(:,2)),:) = [];
ScaleFactor will depend on what your criteria is..
Upvotes: 0
Reputation: 21563
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))
Upvotes: 4