How to combine the name of struct together

1 vue (au cours des 30 derniers jours)
Sharah
Sharah le 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?

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by