stateflow chart 에서 구조체 데이터형 선언하는 방법
显示 更早的评论
Stateflow 모델 에서 구조체 데이터형을 사용 하려 합니다.
예를들어 X 라는 구조체에
- X.A
- X.B
- X.C
라는 3개의 필드를 가진 구조체를 데이터 형으로 선언해서 모델에서 해당 데이터형을 사용 하고 싶습니다.
사용하는 방법 문의 드립니다.
回答(1 个)
Animesh
2024-2-16
In Stateflow, you have the ability to define a structure as "parameter data" and access its individual fields using dot notation.
For example, consider the following MATLAB code where we define a structure named "structA" with fields "f1", "f2", and "f3”
structA = struct('f1', 6, 'f2', 22, 'f3', 100);
Now,to use "structA" within your Stateflow chart, follow these steps:
- Open the symbols pane in Stateflow.
- Click “Create data”
- Set the data type to "Parameter data."
- Name the new data symbol "structA".
I have attached an example model for your reference.
类别
在 帮助中心 和 File Exchange 中查找有关 복잡한 논리 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!