Effacer les filtres
Effacer les filtres

Accessing variable in struct using string

9 vues (au cours des 30 derniers jours)
Haziq Razali
Haziq Razali le 7 Déc 2018
Modifié(e) : Stephen23 le 7 Déc 2018
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)

Réponse acceptée

Adam
Adam le 7 Déc 2018
Modifié(e) : Adam le 7 Déc 2018
behaviours{1,1}.( ped )
should work

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by