MATLAB: How to unlock or lock a custom Simulink block library from the MATLAB command prompt

commandlibrarylinelockprogrampromptsimulink

I would like to write a function which unlocks my custom Simulink block library, makes some changes and then locks the library again. I would then like for those changes to propagate through models that reference blocks from the library.

Best Answer

This information was incorporated into Simulink 6.3 (R14SP3) documentation. For previous product releases, read below:
This can be accomplished using the SET_PARAM function as follows from a MATLAB script or from the MATLAB command window:
set_param('your_library_name','Lock','off')
You can lock the library by setting this property to on:
set_param('your_library_name', 'Lock', 'on')