MATLAB: How tatement to use if statement to eliminate unwanted value

eliminate unwanted value from an array

Hi,.
I have set of values like .001,0.002,…inf
i want to find the max value from these excluding inf
X=U/10000;
i=[X]
m=max(i);
if m == Inf;
m=m(i-1);
end
How to get rid of Inf.

Best Answer

m=max(i(i~=Inf));