how to put a matlab script in a simulink bloc

조회 수: 3 (최근 30일)
aicha cher
aicha cher 2012년 3월 6일
hi,
i'm trying for quite a while to integrate a matlab script in a simulink bloc so the script will be executed with the model, but i didn't succeed can u help me please.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2012년 3월 6일
To call MATLAB code from a Simulink model, you need to use one of the three MATLAB Function Blocks available. Which one are you using, and what error(s) do you receive?
  댓글 수: 2
aicha cher
aicha cher 2012년 3월 6일
well thx for responding, my script doesn't contain any function therefor i can't use Fcn block the only solution i can use is to generate C code for my script and to put the code in a s-fonction but i don't know how to generate the c code of a script
Kaustubha Govind
Kaustubha Govind 2012년 3월 7일
You can use the MATLAB Coder product to generate code from a MATLAB function (not a script), but you can convert your script to a function by simply adding a "function [outputArgs] = myfunctionname(inputArgs)" line at the top of your script.

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

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by