MATLAB: Run a compilation of mdf file from Matlab

automationcompilationMATLABsimulink

Hello,
Is it possible to start the compilation of a simulink model since Matlab command Window? If yes, is it possible to specify some parameters for the compilation (like System target file)?
My wish: create a .m file to automate two compilations of a specific mdl file, with two different System target files (tlc). Today I've have to manually change the tlc and start the compilations

Best Answer

Assuming that from complication of model, you mean code generation or building a model.
You can change the System target file from command line or from m-file using command
>> set_param('ModelName','SystemTargetFile','TargetName');
% where TargetName could be ert.tlc, grt.tlc etc.
You can start building the model with command
>> rtwbuild('ModelName');
Related Question