Automating Simulink Code Generation from DOS Command Window
이전 댓글 표시
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
Mady J
2018년 9월 4일
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
채택된 답변
추가 답변 (1개)
Fangjun Jiang
2011년 12월 15일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Simulink Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!