How to find largest magnitude in matrix?
14 views (last 30 days)
Show older comments
Roy dela Rama
on 9 Mar 2016
Commented: Roy dela Rama
on 9 Mar 2016
2 1 7
3 4 2
11 -22 13
B = largest magnitude
B = -22
0 Comments
Accepted Answer
Image Analyst
on 9 Mar 2016
Try this:
B=[2 1 7
3 4 2
11 -22 13]
[maxB, index] = max(abs(B(:)))
maxB = maxB * sign(B(index))
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!