How to combine the name of struct together

1 Ansicht (letzte 30 Tage)
Sharah
Sharah am 16 Nov. 2016
Beantwortet: Alexandra Harkai am 16 Nov. 2016
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?

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by