MATLAB Answers

How to combine the name of struct together

1 view (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?

  0 Comments

Sign in to comment.

Accepted Answer

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

  0 Comments

Sign in to comment.

More Answers (0)

Tags


Translated by