Find the largest element and its location in a 3 dimensional array
2 次查看(过去 30 天)
显示 更早的评论
How to find the largest element and its location in case of a 3 dimensional array in Matlab?
0 个评论
采纳的回答
Walter Roberson
2021-8-8
编辑:Walter Roberson
2021-8-8
[largest_value, idx] = max(YourArray, [], 'all', 'linear');
[row, col, page] = ind2sub(size(YourArray), idx);
In older releases you would probably use
[largest_value, idx] = max(YourArray(:));
[row, col, page] = ind2sub(size(YourArray), idx);
2 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!