Access embedded coder settings programmatically

조회 수: 1 (최근 30일)
fraben
fraben 2022년 2월 5일
댓글: fraben 2023년 10월 11일
Hello, is it possible to edit/access the current embedded coder settings from a script? Alternatively, is it possible to at least create a dump of the currently used ones?

채택된 답변

Kausthub
Kausthub 2023년 10월 9일
Hi fraben,
I understand that you would like to know whether you can edit and configure Embedded Coder’s settings from a script and you would like to create a dump of the current configurations as well.
You can obtain the model’s configurations using the getActiveConfigSetfunction. You can use this function as:
cs = getActiveConfigSet(model);
The following documentation link will give you more details about the function:
Once you get the configurations you can interact with code generation options using get_param and set_param. An example for this would be:
deftParamBehvr = get_param(model,'DefaultParameterBehavior'); % Get
set_param(model,'DefaultParameterBehavior',deftParamBehvr) % Set
For creating a dump of the current configuration, you can use the saveAs function. This will create a dump of all the configurations in an M file. For example:
% Save the model's configuration parameters to the file 'MyConfig.m'.
saveAs(cs,'MyConfig');
You can refer to the below mentioned documentation for further clarifications:
Hope this helps and solves your query regarding editing Embedded Coder configurations programmatically!
  댓글 수: 1
fraben
fraben 2023년 10월 11일
Thank you! That was a very useful answer!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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