How to combine the name of struct together

2 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Structures in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by