MATLAB: MATLAB Operation question.

duplicate post requiring mergingMATLAB

HI,
I have an array:
angle =
Columns 1 through 5
174.8310 -4.9214 -5.0368 -5.0544 -4.2956
Columns 6 through 9
-2.9111 -5.0442 -5.7359 -5.0155
I would like to filter off the number that has less occurrence( Eg. 174.831 , -2.9111) while keeping those value that repeats.
Is there any matlab function that can do that?
Thanks

Best Answer

% Identify the elements that are too high or too low
isTooHi = (angle>-4.5);
isTooLo = (angle<-5.5);
% Remove them
angle(isTooHi|isTooLo) = [];