Accessing variable in struct using string

9 次查看(过去 30 天)
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

更多回答(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