Maximum and Minimum values of a field structure array
6 ビュー (過去 30 日間)
古いコメントを表示
Hi, I have structure array as shown in the image below. How can i find the maximum and minimum population with the corresponding state for the available data.
Thanks in advance.
0 件のコメント
回答 (1 件)
Birdman
2020 年 4 月 2 日
%find max and min population
[Cmax,maxIdx]=max(AustralianStates.Population)
[Cmin,minIdx]=min(AustralianStates.Population)
%find corresponding state
AustralianStates.Name([minIdx maxIdx])
%find corresponding land area
AustralianStates.Land_Area([minIdx maxIdx])
8 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!