MATLAB: How to find a maximum number not considered minus sign

findmaxmax no

Sir,
I want find the maximum number in the given array.
But, I am not considered negative sign.
for example, a=[4, 3, -8],
output is = -8. Because 8 is the maximum number.
how I get this output.
thank you.

Best Answer

a = [4, 3, -8];
[~,ii] = max(abs(a));
out = a(ii);