is there any command to find a maximum value of a matrix containing negative numbers also ??
61 views (last 30 days)
Iain on 6 Jun 2013
No single line command, but
largest_val = (-min(x) < max(x))*(max(x)-min(x))+min(x);
is cheeky and it preserves the sign.