Call a Matlab function in Simulink for later code generation

Hello!
I need to use a MATLAB function in my Simulink project.
The problem is that this function needs to call other functions and load data from *.mat files (see image).
I also need to generate the code using Simulink Coder and Embedded Coder.
Which technique should I adopt from the answer below ?

댓글 수: 2

What exact issue are you facing?
Calling a function should work, when the file is on the search path.
When loading a mat-file you could use:
coder.load
Thank you for further feedback.
Hello Olivier,
Finaly, it was the error that I've used a load() instead of coder.load() command for loading *.mat files. So now all works.

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

 채택된 답변

Dimitri
Dimitri 대략 15시간 전

1 개 추천

Finaly, it was the error that I've used a load() instead of coder.load() command for loading *.mat files. So now all works.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2026년 4월 23일 9:14

답변:

대략 15시간 전

Community Treasure Hunt

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

Start Hunting!

Translated by