About maximum value in matrix
显示 更早的评论
I have a problem regarding finding a maximum value from my matrix (largest element in the row)
I have matrix A shown bellow

I know that I can use
M=max(A,[],2)
Then I will get matrix M such that

But the answer I want is not that, what I want is that . The one that I want is

The answer that I want is the maximum value of each row ignoring the negativity of each value like shown in the matrix above.
I hope my question is clear enough.
采纳的回答
更多回答(1 个)
Fangjun Jiang
2018-8-6
0 个投票
use abs() and note that the second return of max() gives the indices. See if you can figure it out.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!