Setup BuildDirSuffix based on rtwoptions

조회 수: 2 (최근 30일)
Olaf Oelsner
Olaf Oelsner 2017년 3월 14일
답변: Olaf Oelsner 2017년 3월 24일
Hi,
I would like to change the BuildDirSuffix based on rtwoptions
rtwoptions(myoption).prompt = 'Version';
rtwoptions(myoption).type = 'Popup';
rtwoptions(myoption).default = '1';
rtwoptions().popupstrings = '1|2|3';
The option should be used to define the BuildDirSuffix
rtwgensettings.BuildDirSuffix = '_mytarget' + rtwoptions(myoption).value + '_rtw';
Is this possible? Thank you for your help.
Olaf

채택된 답변

Shivang Menon
Shivang Menon 2017년 3월 24일
Yes, there is a way to do this. You can set the tlcvariable field for the rtwoptions parameter. This field is basically the parameter that appears in the config set (and you get the parameter value by passing this field). To set the BuildSuffixDir, get the active config set and get the value of the required parameter. Refer to code below:
rtwoptions(myoption).prompt = 'Version';
rtwoptions(myoption).type = 'Popup';
rtwoptions(myoption).default = '1';
rtwoptions(myoption).popupstrings = '1|2|3';
rtwoptions(myoption).tlcvariable = 'versionValue';
%----------------------------------------%
% Configure RTW code generation settings %
%----------------------------------------%
cs = getActiveConfigSet(gcs);
tmp = cs.get_param('versionValue');
rtwgensettings.BuildDirSuffix = ['_mytarget' tmp '_rtw'];
rtwgensettings.Version = '1';
I believe making the above changes in tlc should fix your issue. Refer to this MATLAB Answer with a similar problem:- https://www.mathworks.com/matlabcentral/answers/98859-how-can-i-change-the-code-generation-directory-depending-on-my-selection-of-the-system-target-file-i
Also, you can also try using TLC Options parameter in configuration parameters - TLC Options
Hope this helps!

추가 답변 (1개)

Olaf Oelsner
Olaf Oelsner 2017년 3월 24일
That worked!
Thank you!

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by