Dealing with Simulink libraries
I have a - maybe very simpl开发者_StackOverflow中文版e - problem:
I created my own library and dragged my custom blocks into a new model. After closing my library window my simulation didn't find any of those blocks, because it isn't opended as window.
How can I workaround this problem by adding a reference or something similar?
Greets, poeschlorn
You can use the PreLoadFcn callback of the model to load the library (load_system).
The library doesn't have to be open when you start the simulation, Simulink will automatically resolve the library link and load the library when necessary. But, the library has to be on your MATLAB path after you save it. Make sure that the directory where you saved the library is on your path.
精彩评论