sl_customization not refreshing Simulink Library Broswer

5 次查看(过去 30 天)
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

回答(1 个)

Suman
Suman 2024-2-15
编辑:Suman 2024-2-15
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!

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by