필터 지우기
필터 지우기

C Union data type in Matlab/Simulink

조회 수: 18 (최근 30일)
vamshi krishna kammadanam
vamshi krishna kammadanam 2022년 4월 13일
답변: Muthukumar Ganesan 2022년 8월 20일
Hi all,
I am trying to port embedded hardware driver files written in C to Simulink using C Caller.
I am able to port it except the Union datatype. Matlab does not recognise this data type.
Has anyone been able to solve this?
The final aim is to use embedded coder to generate C code to run the hardware.

답변 (2개)

Mark McBroom
Mark McBroom 2022년 4월 16일
You are correct that Simulink does not support unions. If you plan to use only one of the union-ed fields in your Simulink model, you can temporarily replace the union-ed field with the actual field you will use in Simulink. After genratig code, you can switch back to the original header file that contains the union.
THanks.
Mark.

Muthukumar Ganesan
Muthukumar Ganesan 2022년 8월 20일
Hi,
One of the workaround is here.
Thanks

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by