我在算术中问这个问题

我为Simulink实时编写驱动程序,需要在matlab中使用一些函数来实现sfunction

我看到“mexcallmatlab”但不幸的是它无法用于slrt(代码生成不支持并且模型构建时会生成错误)

### Compiling ..\SyT1.c 
cl  -D_MT -MT /wd4996 /fp:precise -DON_TARGET_WAIT_FOR_START=0 /W3 /c /nologo 
/O2 /Oy- -DMODEL=t2 -DRT -DNUMST=2  -DTID01EQ=1 -DNCSTATES=0  -DMT=0 - 
DHAVESTDIO -DXPCMSVISUALC  -DXPCCALLCONV=__cdecl  -DUSE_RTMODEL -DERT_CORE  
..\SyT1.c 
SyT1.c
..\SyT1.c(164) : error C2065: 
'mexCallMATLAB_is_not_supported_by_Simulink_Coder' 
: undeclared identifier 
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 
10.0\VC\BIN\cl.EXE"' : return code '0x2' 
Stop. 
The make command returned an error of 2 
'An_error_occurred_during_the_call_to_make' is not recognized as an internal 
or 
external command, 
operable program or batch file.

一个解决方案是将变量发送到matlab并使用matlab函数然后将结果反馈到sfunction all一个序列中的一个步骤直到开始slrt运行模拟之前和构建之后 . 但我不想在我的模型块中使用输入和输出端口,并改变该过程的基本结构 .

我可以使用局部变量或任何状态在sfunction和matlab之间进行传输吗?

谢谢 .