How to combine the name of struct together

2 visualizaciones (últimos 30 días)
Sharah
Sharah el 16 de Nov. de 2016
Respondida: Alexandra Harkai el 16 de Nov. de 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?

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by