How to combine the name of struct together

2 views (last 30 days)
I am trying to add data into few struct with different name, say if
k = 'TD',
put data into
Data.TD(i).somethingelse
and if
k = 'AB',
put some data into
Data.AB(i).somethingelse
can anyone enlighten me?

Accepted Answer

Alexandra Harkai
Alexandra Harkai on 16 Nov 2016
Data.(k)(i).somethingelse = your_value
See the Documentation for reference.

More Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!