How to combine the name of struct together

조회 수: 2 (최근 30일)
Sharah
Sharah 2016년 11월 16일
답변: Alexandra Harkai 2016년 11월 16일
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?

채택된 답변

Alexandra Harkai
Alexandra Harkai 2016년 11월 16일
Data.(k)(i).somethingelse = your_value
See the Documentation for reference.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by