How can I change the build folder of a model?
81 views (last 30 days)
Show older comments
I can use the fuction rtw.getBuildDir(..) to see the build information of the model. But is there a way to set/change these information? e.g. rtw.setBuildDir? Especially i want change the 'BuildDirectory' and the name of the Folder.
0 Comments
Answers (3)
Sebastian Castro
on 17 Mar 2016
You can do this using the Simulink preferences or the Simulink.fileGenControl function. Take a look at this blog:
- Sebastian
3 Comments
William Katzianer
on 27 Dec 2018
Edited: William Katzianer
on 27 Dec 2018
Simulink.fileGenControl has a nice help-file to do exactly what you wanted.
You need to first get the current configuration:
cfg = Simulink.fileGenControl('getConfig');
Then edit the data structure inside cfg to point to where you want the new build to be located at
For example:
cfg.CodeGenFolder = fullfile(pwd, '\SomeNewDirectory');
Then you'll need to set it using 'setConfig'
Simulink.fileGenControl('setConfig', 'config', cfg);
This worked for me to control where the build folders and cache folders need to go to.
EDIT: Doesn't look like you can actually change the folder name. What you could do I suppose is create a Directory name of your choosing and set that as where all of the simulink artifacts go.
0 Comments
Djordje
on 5 Sep 2024
I wanted to remove suffix (_grt_rtw).
Proceeded with following steps:
- Created custom .tlc file within my project -> copied existing one (C:\LegacyApp\Matlab2024a\rtw\c\grt\grt.tlc) into project repository, and renamed it (grt_custom.tlc).
- Added location of the new .tlc file to the MATLAB project path, so that it can be found.
- Updated model configuration, choosen the new one (grt_custom.tlc). If it is not visible as an option, it could be that file location is not within MATLAB path.
- Some configuration entries were changed, so I reverted them back.
- Uncommented line (it was commented out within the whole block): rtwgensettings.BuildDirSuffix = '_grt_rtw';
- In order to remove suffix, changed this line to: rtwgensettings.BuildDirSuffix = '';
Matlab version: R2024a
0 Comments
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!