sl_customization not refreshing Simulink Library Broswer

6 visualizzazioni (ultimi 30 giorni)
Hello,
I've created a simple sl_customization file to hide certain blocks in the general Simulink library view. When I call the function and run the sl_refresh_customizations command in the prompt, the below blocks are still displayed.
Using the command which sl_customization shows that the file path is correct and points to the one that I had created.
Additionally, running the command sl_customization(cm) generates an error "Unrecognized function or variable 'cm'."
Is there something that I misunderstanding in the use of the function or the file structure?
Thank you for your help.
function sl_customization(cm)
cm.LibraryBrowserCustomizer.applyFilter({'simulink/Commonly Used Blocks/Bus Creator','Hidden'});
cm.LibraryBrowserCustomizer.applyFilter({'simulink/Commonly Used Blocks/Bus Selector','Hidden'})
end

Risposte (1)

Suman
Suman il 15 Feb 2024
Modificato: Suman il 15 Feb 2024
Hi Leonid,
As per my understanding, you want to hide some blocks from the Simulink Library view using a custom "sl_customization" file and when you run the "sl_customization" function, you are getting the error: "Unrecognized function or variable 'cm'."
You are getting this error because the customization manager object (cm) is not available in that context. Please note that you do not need to explicitly call the "sl_customization" function. When you run the "sl_refresh_customizations" command, it searches the MATLAB path for all available "sl_customization.m" files and executes them.
Hence, in order to any kind of customizations, you may follow these steps:
  • write an "sl_customization" function wherein you specify your customizations
  • add the "sl_customization.m" file to the MATLAB path
  • run the "sl_refresh_customizations" command at the MATLAB command line
I hope that helps!

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by