how to find the column number of a matrix?
3 次查看(过去 30 天)
显示 更早的评论
I have a simple question though I couldn´t find an answer for that. I have a matrix A= [ 3 4 , 6 7]
I want to find which column gets the maximum value from first raw elements and which column gets the maximum value from 2nd raw values. I know I can derive maximum value from this max(A(1, :)) . But I can´t find it´s column number. Thank you in advance.
0 个评论
采纳的回答
madhan ravi
2018-11-18
编辑:madhan ravi
2018-11-18
[value,index]=max(A(1,:))
By default the second output of max will give you the index you require.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!