필터 지우기
필터 지우기

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

추가 답변 (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