Simple question - how do I unlock a Simulink (i.e. part of MATLAB) block library to edit it?
Asked
Active
Viewed 4,553 times
1 Answers
4
There are two ways to unlock a library:
Direct UI method - Ultra-simple, good in at least Matlab 2019a and later - after opening the library, in the bottom left corner of the library window, there is a "lock" icon. Click it.
The Library will automatically relock after saving and closing it.
Programmatically Unlock the Library
- Open the library (directly or programmatically)
- Use the following code, where
my_library
is the base name of the library without the*.slx
extension:
set_param('my_library', 'Lock', 'off');
Note:
If the library is currently the Simulink window in focus, you can use the
gcs
command (get current system) instead of themy_library
name.-
set_param(gcs, 'Lock', 'off');

LightCC
- 9,804
- 5
- 52
- 92