Why do I get an "Error in sl_customization" when I start Simulink?

18 views (last 30 days)
While trying to start Simulink, or when I open any Simulink example, I see a warning in the MATLAB Command Window that contains an "Error in sl_customization". 
Warning: Unrecognized function or variable 'slReloadToolstripConfig'.
Error in sl_customization (line 3)
    slReloadToolstripConfig;
 
> In slCustomizer/callAll
In slCustomizer/refresh
In slCustomizer.staticRefresh
In simulinkrc (line 51)
In Simulink.start_simulink 
Why do I get this warning, and how can I avoid it?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 Oct 2023
When Simulink is started, the command "sl_refresh_customizations" is executed. As a result, all "sl_customization.m" files on the MATLAB path and in the current folder are run. The message "Error in sl_customization" indicates one of these "sl_customization.m" files contain faulty code and could therefore not be executed.
Run the following command in the MATLAB Command Window to get a list of  all "sl_customization.m" files on your MATLAB path:
>> which -all sl_customization
Then, go through the listed "sl_customization.m" files and inspect their source code. In the particular example presented in this article, the warning was caused by an "sl_customization.m" file that had a call to "slReloadToolstripConfig" in line 3. This function was only introduced in R2021b and will lead to an "unrecognized function" error when executed in R2021a and prior.
Note that "sl_customization.m" files are often on your MATLAB path as part of a third-party toolbox or blockset. Sometimes, toolbox authors choose to obfuscate the "sl_customization.m" file, so that only an "sl_customization.p" is present which cannot be opened. If the warning only occurs when this "sl_customization.p" file is present on the path, reach out to the toolbox author to fix the source code.

More Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!