フィルターのクリア

Accessing variable in struct using string

9 ビュー (過去 30 日間)
Haziq Razali
Haziq Razali 2018 年 12 月 7 日
編集済み: Stephen23 2018 年 12 月 7 日
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 日
behaviours{1,1}.( ped )
should work
  1 件のコメント
Guillaume
Guillaume 2018 年 12 月 7 日
will work.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by