call MEX-Funcion in a simulink userdefined block
3 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Kaustubha Govind
on 30 Apr 2013
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 Comments
Kaustubha Govind
on 6 May 2013
omid: You need to create mxArray's for both - use mxCreateString for the first and mxCreateDoubleScalar for the second.
See Also
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!