Why can't we call struct array in C language mode in stateflow

I set the action language of stateflow to C language, and call the structure in stateflow like this;
"length = linkObjectS.adasDataInfo[0].length"
But there are always compilation errors.
"Indexing into arrays of structures is not supported in C action language."
But what is written in the help document can be used in this way
“In diagrams using C as the action language, use the 0-based index separated by square brackets。”

답변 (1개)

Muthukumar Ganesan
Muthukumar Ganesan 2022년 7월 25일

0 개 추천

Hi,
Yes, Stateflow doesn't support accessing Bus arrays but it is possible with some workaround. I have prepared one and it is available here. Hope this helps.
Thanks.

카테고리

도움말 센터File Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2022년 6월 20일

답변:

2022년 7월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by