MATLAB Answers

Need to run sl_refresh​_customiza​tions each time I open my Simulink project

24 views (last 30 days)
Jonas on 23 Jul 2019
Commented: Fangjun Jiang on 24 Jul 2019
I have created a custom target for my Simulink Embedded Coder code generation. The target is stored in a Target file inside the Simulink Project.
Now each time I open my Simulink Project, the Configuration Settings complain about my custom Target not being registered. A solution is to run the command sl_refresh_customizations after which everything runs fine again with the custom Target.
My question is: why do I need to run sl_refresh_customizations each time I open my Simulink Project? Is there another solution? I have put the command in a start-up script as of now but I think it is not so clean.
With kind regards,


Sign in to comment.

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 23 Jul 2019


Jonas on 24 Jul 2019
The documentation says that the command sl_refresh_customizations needs to run if I change sl_customization.m, but I am not changing it (I also never made such a file). Why do I need to run the command each time?
Is it because the Simulink Configuration menu does not know my custom target, and a side-effect is that the Simulink Editor menus are rebuilt after which it does recognize it?
Fangjun Jiang
Fangjun Jiang on 24 Jul 2019
The usual way is to create your target file, register it in a sl_customization.m file and put the files in the MATLAB path. All the sl_customization.m files are searched and executed when MATLAB is started. Your didn't do that but your model is using your customized target file. That is why you need to run the manual step or put it in startup.
Target file is regarded as a type of "system configuration". Every person/model/project using your installation of MATLAB will be able to pick this target once it is registered. You could continue using the manual approach if it is only used by this project.
Run "which -all sl_customization.m", you may see none or multiple files depending on your system.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!