MATLAB Answers

Maximum and Minimum values of a field structure array

19 views (last 30 days)
Rishitha Muchinthala
Rishitha Muchinthala on 2 Apr 2020
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.


Sign in to comment.

Answers (1)

Birdman on 2 Apr 2020
%find max and min population
%find corresponding state
AustralianStates.Name([minIdx maxIdx])
%find corresponding land area
AustralianStates.Land_Area([minIdx maxIdx])


Show 5 older comments
Rishitha Muchinthala
Rishitha Muchinthala on 3 Apr 2020
Hi @Akira Agata,
I tried the first code and i got the below error.
"Expected one output from a curly brace or dot
indexing expression, but there were 8 results.
Error in A2_19508724 (line 108)
Rishitha Muchinthala
Rishitha Muchinthala on 3 Apr 2020
Thank you,
Akira's second code is working.
I got the result.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by