How transfer variable between matlab and Sfunction

Hessam Source

I ask this question in mathwork

I write driver in c sfunction for Simulink real-time and need to use some function in matlab for sfunction

I see "mexcallmatlab" but Unfortunately it unusable for slrt (code generation not support and An error is generated when model build )

### 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 - 
..\SyT1.c(164) : error C2065: 
: undeclared identifier 
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 
10.0\VC\BIN\cl.EXE"' : return code '0x2' 
The make command returned an error of 2 
'An_error_occurred_during_the_call_to_make' is not recognized as an internal 
external command, 
operable program or batch file.  

one solution is send variable to matlab and use matlab function then feedback result to sfunction all For once in a sequence multi-step until before start slrt run simulation and after building. but i dont want use input and output port in my model block and change basically structure for that procedure.

Can I use local variable or any state for transferring between sfunction and matlab and how ?




comments powered by Disqus