Automating Simulink Code Generation from DOS Command Window
Mostrar comentarios más antiguos
First, I am relatively a newbie for MatLab and Simulink - surrounded by very smart ME's writing very cool stuff.
What I want to do is take all of the manual point and click and turn this into a batch file to run from a DOS Command Window in order to load the models and generate the code for all of the models.
What I am attempting to create is an automated build script to run at night in batch mode. Pull all code from our Configuration Management tool, build all models, and then compile.
I am using MatLab 2011b, Simulink Coder, and TI Code Composer 5 (Eclipse)
Can someone point me at a tutorial or instructions on how to do this. I have been searching for answers to this question for a while and finally decided to just ask the question.
Thank you in advance.
David Clark LORD Corporation
1 comentario
Mady J
el 4 de Sept. de 2018
Hello David, My scenario is also same as yours. I need to know is there any document or website from where i can get complete list of windows command for matlab and simulink code generation.
Thank you Mady
Respuesta aceptada
Más respuestas (1)
Fangjun Jiang
el 15 de Dic. de 2011
0 votos
There are many things involved. But at the high level, you just need to set up two things. Of course, all the related files, configurations, etc have to be tested. I think your question is primarily about how to set up the automation assuming you've been able to do individual task successfully.
- From DOS command, you can start MATLAB with the -r optoin. "MATLAB -r MyCodeGenRoutine" will start MATLAB and then run MyCodeGenRoutine.m automatically.
- In your MyCodeGenRoutine.m, basically you need three lines. "open_system(Model);rtwbuild(Model);close_system(Model)'
- If you have multiple models, than you can put the three lines in a loop. After it's done, you can use "exit" command to close MATLAB.
Categorías
Más información sobre Simulink Coder en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!