필터 지우기
필터 지우기

How to access structure elements in the stateflow charts

조회 수: 5 (최근 30일)
Hemanadhan S V
Hemanadhan S V 2021년 3월 25일
답변: Mark McBroom 2024년 2월 17일
Hello,
I have created struture called carconfiguration which has five elements( Ato E). and i need to feed this carconfiguration as input to stateflow chart. so after creating the structures def in m file i save and ran the m file so now the CarConfig struct is created. but inside the stateflow chart when try to access the elements of the struture like below,
CarConfig == CarConfig.C(I need the third config so i am using C here) i am getting error as the element C is not found or unresolved elements C.
Can anyone help me how to access the structure elements inside the stateflow charts.
  댓글 수: 1
Ntiana Sakioti
Ntiana Sakioti 2021년 7월 1일
Are you able to provide the structure definition file as well as how you defined CarConfig in your chart?

댓글을 달려면 로그인하십시오.

답변 (1개)

Mark McBroom
Mark McBroom 2024년 2월 17일
  1. You will need to create a Simulink.Bus with the same layout as the matlab structure.
  2. Create a Simulink.Parameter called CarConfig. Set its "Value" property to carconfiguration. Set it "Type" property to the Simulink.Bus created in step 1.
  3. In Stateflow, create a Parameter called CarConfig in the Stateflow

카테고리

Help CenterFile Exchange에서 Complex Logic에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by