Find the largest element and its location in a 3 dimensional array
5 ビュー (過去 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 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!