https://se.mathworks.com/help/simulink/slref/simulink.exporttotemplate.html
Simulink.exportToTemplate - Create template from model or project - MATLAB
This MATLAB function creates a template file (templatename.sltx) from a model or project specified by obj.
create templatesimulinkmodelprojectmatlab