Can i use the same MATLAB function in Simulink multiple times?

In Simulink I have a MATLAB function defined which I need at multiple calculation steps so I just copied the entire MATLAB function block.
Can I define the function in a separate .m-file so that if I update the function, every instance of it automatically uses the updated version? If so, how can I implement this?

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2018년 12월 6일

0 개 추천

I would assume so. Just create that function and save it in your MATLAB path and then call it in your MATLAB Function block. You may also consider using the "Fcn" block or "Interpreted MATLAB Function" block.

추가 답변 (0개)

카테고리

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

제품

릴리스

R2018b

질문:

2018년 12월 6일

답변:

2018년 12월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by