Maximum and Minimum values of a field structure array
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rishitha Muchinthala
el 2 de Abr. de 2020
Comentada: Rishitha Muchinthala
el 3 de Abr. de 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.
0 comentarios
Respuestas (1)
Birdman
el 2 de Abr. de 2020
%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 comentarios
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!