MATLAB: Is it possible to add a library to the Simulink Library Browser in Matlab Simulink 7.6 (R2010b)

add custom library browser simulink adding matlab 2010b 7.6simulink

From the simulink library browser is possible to create a new library. I would like to shows this custom library in the Simulink Library Browser. The methods I found online don't apply for my version of matlab/simulink (7.6 – R2010b).

Best Answer

function blkStruct = slblocks
BlocksetName = 'YourLibrary';%mdl file name
Browser(1).Name = 'My Library';%How it appears in Simulink library
blkStruct.Name = sprintf('My Library');
blkStruct.OpenFcn = BlocksetName;
blkStruct.MaskDisplay = '';
Browser(1).Library = BlocksetName;
Browser(1).IsFlat = 0;% Is this library "flat" (i.e. no subsystems)?
blkStruct.Browser = Browser;
end