MATLAB: What does it mean when it is said that a struct is a 2-by-3 struct
struct
What does it mean when it is said that a struct is a 2-by-3 struct?
Best Answer
Just like a numericarray, a structurearray can be scalar, vector, matrix, or ND. If you have been using structures already then most likely they were scalar structures.
If all of the child structures have exactly the same fields then you would be much better off using anon-scalar structure instead of nested structures:
S(1).field = ...
S(2).field = ...
S(3).field = ...
Then you could trivially do this:
find([S.field] == 2)
Using a non-scalar structure would make your code much simpler and more efficient.
Best Answer