Assuming you have a structure myStruct
with numeric fields, you can use the structfun
and min
/max
functions to find the minimum and maximum values.
To find the minimum value:
main.m43 chars2 lines
To find the maximum value:
main.m43 chars2 lines
In both cases, structfun
applies the min
or max
function to each field of the structure, and the outer min
or max
function finds the minimum or maximum value of all the fields.
Note that if your structure has fields with different lengths, you will need to adjust the code above to handle that case appropriately.
gistlibby LogSnag