Info

This question is closed. Reopen it to edit or answer.

summation of numerical values stored in multi-layerd structs

1 view (last 30 days)
If I had a multi-layered struct with numerical values, how would I go about adding all the numbers in the struct?
  1 Comment
Stephen23
Stephen23 on 5 Nov 2018
Edited: Stephen23 on 5 Nov 2018
There is no magic to work with nested structures: just use loops and access the values, or use getfield. If you use a simple structure array without nesting then you can use comma-separated list:

Answers (0)

Community Treasure Hunt

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

Start Hunting!