call MEX-Funcion in a simulink userdefined block

3 次查看(过去 30 天)
Hi, I have a MEX-function that have several inputs and 2 outputs. In addition I creat a simulink model whit several blocks. I need to call the MEX-Function whit these blocks in the model. how can I do it? It's important for me that arrive to minimum executing and calling time.

回答(1 个)

Kaustubha Govind
Kaustubha Govind 2013-4-30
MEX-functions can essentially be called just like any other MATLAB function. Please see the available MATLAB Function blocks to find a Simulink block that can be used to execute a MATLAB function.
  6 个评论
omid jab
omid jab 2013-5-6
I studied all of them, but no understand how can creat a pointer such as prhs=['OpenWindow',0]".
Kaustubha Govind
Kaustubha Govind 2013-5-6
omid: You need to create mxArray's for both - use mxCreateString for the first and mxCreateDoubleScalar for the second.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by