How to add MEX files to a custom library
Mostra commenti meno recenti
I want to create a custom library to use with my friends in Simulink. What I do respectively is here:
- Create several S-Functions and then create MEX files with "mex" command
- Create a library (.mdl) and place my S-Functions in it
- Cut&paste the library file(mylibrary.mdl) in the directory $matlabroot/toolbox/mylibrary
- Copy MEX files (of S-Functions) in the directory $matlabroot/toolbox/mylibrary
- Create slblocks.m (to display my library in Library Browser) file in the directory $matlabroot/toolbox/mylibrary
I can see my library and S-Functions in the Library borwser and also I can drag and drop S-Functions blocks into any model. But when I try to generate code of a model I get this error:
"Error in S-function '{MODEL_NAME}/{S_FUNCTION_NAME}': S-Function '{S_FUNCTION_NAME}' does not exist"
So, where do I need to place MEX files to generate code of models with using my custom library?
Regards, Vahit.
Risposte (1)
Kaustubha Govind
il 2 Apr 2012
I'm assuming that $matlabroot/toolbox/mylibrary has already been added to your MATLAB path since you say that your library shows up in the Simulink library browser. Could you run this command and try running Ctrl+D (update) on your model?
>> rehash toolboxcache
Categorie
Scopri di più su Simulink Coder in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!