How do I add a custom library to the Simulink Library Browser in Simulink 4.1(R12.1)?

44 vues (au cours des 30 derniers jours)
I have created a custom library in Simulink 4.1(R12.1) and would like to add it to the Simulink Library Browser.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 30 Déc 2021
Modifié(e) : MathWorks Support Team le 16 Nov 2021
The ability to add custom libraries to the Simulink Library Browser is available in Simulink 4.1(R12.1). Refer to the documentation link below for more information.
In particular, refer to the "Create Block Libraries" and "Add Libraries to the Library Browser" sections in the documentation.
The 'slblocks.m' files shipped with Simulink are commented and explain the necessary modifications. You can view one of these files by typing the following at the MATLAB command prompt:
edit slblocks
Follow the instructions outlined in the 'slblocks.m' file and make changes which apply to your custom library.
Here are the general steps to follow:
1. Place each custom library within its own directory.
2. Copy the 'slblocks.m'file into each directory that has one of your libraries. This file is present at the following location.
$MATLABROOT/toolbox/simulink/blocks/slblocks.m
where $MATLABROOT is the directory where MATLAB is installed and can be known by executing the following command at the MATLAB Comamnd Prompt.
matlabroot
3. In order to add these directories with the custom libraries to the MATLAB path and save them, execute the following commands.
addpath('directory')
savepath
4. Make sure that the MATLAB path includes the path to these directories. You can execute the following command at the MATLAB command prompt to find out what directories are on your path.
path
5. Make sure that the name of the customized file is also saved as 'slblocks.m'.
  1 commentaire
Jan
Jan le 12 Jan 2018
@Victor: "Adding a custom library to the Simulink Library Browser in Simulink 4.1(R12.1)" is a very specific task and it requires some experiences to understand it. I think, you need a certain expert level to reconsider this and "layman terms" are not as clear as using the standard terms of Matlab and Simulink.
Do you have a question to a specific sentence? If so, posting them in the comments would be useful.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by