how can i find the min of a multidimensional array

1 view (last 30 days)
i have the following code:
Family(1:4)= struct('relation',{'father','sister','brother','me'},'name',{'Rogelio Garcia Garcia','Leticia Garcia Aguilar','Rogelio Garcia Aguilar','Alejandro Garcia Aguilar'},'state',{'widow','married','married','single'},'age',{60,33,31,27});
A=struct2cell(Family);
array=reshape(A,[2,2,4])
and i wish to find the min value of the ages but i have several problems to find it because i got a error message when i use min(array) thanks

Accepted Answer

Matt J
Matt J on 19 Oct 2014
Edited: Matt J on 19 Oct 2014
min([Family.age])
  1 Comment
Alejandro Garcia
Alejandro Garcia on 19 Oct 2014
thanks a lot, i did not think about it, i thought that the array behaves as a normal matrix. thank you

Sign in to comment.

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!