How do I have RTW EC run a batch file directly after code generation?

3 views (last 30 days)
Please help me understand how I can have RTW run a .m and/or windows batch file directly after the code is generated. I want to automate moving the generated code files and performing post-processing. I am using the ert.tlc

Answers (1)

Kaustubha Govind
Kaustubha Govind on 14 Feb 2011
You can achieve this sort of thing for your own custom target using the 'after_tlc' hook of the STF_make_rtw hook file. For ert.tlc, this file is located at $matlabroot/toolbox/rtw/targets/ecoder/ert_make_rtw_hook.m, but it is not advisable to modify this, since it applies to every model that uses ert.tlc, and you lose your changes when you upgrade MATLAB. The best thing to do is to create a dummy custom target that inherits from ert.tlc with the hook file customized.
  1 Comment
MarkB
MarkB on 15 Feb 2011
If you are planning on moving the generated code *before* compiling it, you will probably also need to modify your template makefile (".tmf") file as well. That may include paths that are no longer correct once you move the files.

Sign in to comment.

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!