Accessing variable in struct using string

Hello,
I am trying to access a variable within a struct named
behaviours{1,1}.pedestrian1
Is it possible to access this variable if I have a string named "pedestrian1" ? Basically something like this
ped = 'pedestrian1'
display(behaviours{1,1}.ped)

 採用された回答

Adam
Adam 2018 年 12 月 7 日
編集済み: Adam 2018 年 12 月 7 日

1 投票

behaviours{1,1}.( ped )
should work

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

タグ

質問済み:

2018 年 12 月 7 日

編集済み:

2018 年 12 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by