MATLAB: Matlab while loop/array help.

so this is what i have to do. i have an array for example
n = [1 2 3 4 0.555 0.25 7 8];
i have to find the minimum of this array but i have to exclude the 0.555 value since this is an anomaly and then find the minimum after this value has been excluded. the data I am actually working with is much bigger.
does anybody know how to write a while loop for this problem in matlab?
this is what i have tried but it is not giving me the correct answer (i have used a if loop int this one:
clear
clc
n = [1 2 1.5 0.5 0.25 3 4 5 6 7];
k = 1:7;
m = min(n);
for a = 1:7
if(n(a) > m)
x = min(n(a))
%newMin= min(newArray);
end
end
is there any way to do this using a while loop?
thank you, your help is much appreciated

Best Answer

Mary, there is no need for a while loop. You can do this simply by excluding the value you and, and then taking the min.
exclude_val = 0.555;
m = min(n(n ~= exclude_val));