I want to use a Simulink mdl to generate C files in an automated fashion. I am currently trying to use an m-script and a dos command shell, but I am having issues with a "do you want to save" dialog hanging the m-script. By experimentation I know that the mdl is being modified when the "set_param" line is run (i.e. no "save" dialog issue if the set_param call is removed), but I need to do some setup of the mdl prior to generating code.
m-script:
rtwdemo_counter
set_param(gcs,'SystemTargetFile','ert.tlc')
rtwbuild(gcs)
exit
dos
matlab -r samplebuild -nosplash -nodesktop
Matlab 7.7.0,471 on Windows XP
My ultimate goal is to auto-generate the code on a continuous integration server (CruiseControl) and I feel there must be a more robust way of accomplishing this with the matlab tool-chain.