I am trying to find max value of a struct but max([tracks(:).matrix]) does not work. It gives me the following error: “Error using horzcat
CAT arguments dimensions are not consistent.” Do you have an idea?
Here is what my struct looks like:
tracks =
1x110470 struct array with fields:
nPoints
matrix
tracks.matrix includes 3D points. For example here is
tracks(1,2).matrix:
33.727467 96.522331 27.964357
31.765503 95.983849 28.984663
30.677082 95.989578 29
You can use array fun, followed by another max to do this:
Or, if you want to retain the size of .x after MAX:
Or, if you know everything is n x 3