Finding maximum value and corresponding variable
5 次查看(过去 30 天)
显示 更早的评论
Dear Matlab expert
P(m,d,L) is a matix and size of P(m,d,L) is [10 40 10]. Total element =10*40*10=4000;
Now I need to find maximum value(one maximum value) for P and corresponding m,d,L.
I am expecting your kind help.
Kind regards
Sohel
0 个评论
采纳的回答
the cyclist
2019-6-24
P = rand(10,40,10); % Some pretend data
[P_max,linear_index_max] = max(P(:)); % Find max and index, for linearized matrix
[mc,dc,Lc] = ind2sub([10 40 10],linear_index_max); % Convert the linear index to subscripts
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!