Create a Matlab Function with the same input of a S-Function

조회 수: 1 (최근 30일)
Antonio Parziale
Antonio Parziale 2018년 12월 15일
편집: Antonio Parziale 2018년 12월 15일
Dear all,
My simulink model contains a SFunction written in Matlab.
If I try to compile the model in Rapid Acceleration Mode the following error is provided.
I read that a soluton is to use a Matlab Function block instead of an SFunction because my code is written in Matlab.
My function needs the following parameters that are provided to an SFunction by default: t, x, u, flag
The outputs of my function are [sys, x0, str, ts] even if only sys is the output of the SFunction Block.
How can i create a Matlab function block that receives the same inputs and get out the same output? Just for example, Where is the flag input?
Thanks
MFile S-functions without a
corresponding TLC file are not supported. You can inline
your S-function (name) by creating a TLC file for it.
You can also remap your S-function to C by creating a
corresponding C Mex source file and a name.tlc file in
the same directory as the MFile S-function which contains
(on the first line):
%%CallAsCMexLevel1
or
%%CallAsCMexLevel2

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by