How to find number of objects in a structure?
Mostrar comentarios más antiguos
Hi I'm new to Matlab. I have the following struct array and I want to save the number of objects of struct in a variable. How can I find number of objects? Any help would be appreciated

1 comentario
What do you mean by 'object'? You mean the number of fields or the total number of things across every field? In your example you seem to just mean the number of elements in one field of the struct. If that is the case then you would be better always calculating it on demand to ensure you don't have to keep it up to date. Even better, use a class and a dependent property, but that s slightly more advanced.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Structures en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!