How to set Polyspace configuration options for a model programmatically?

3 ビュー (過去 30 日間)
I would like to know how to use the parameter PSAddSuffixToResultDir in the Polyspace configuration.

採用された回答

MathWorks Support Team
MathWorks Support Team 2022 年 12 月 6 日
編集済み: MathWorks Support Team 2022 年 12 月 6 日
You can set Polysapce configuration options after getting the Simulink ConfigSet as below.
bdclose all;
openExample('polyspace_code_prover/OpenModelForCodeGenerationAndPolyspaceAnalysisExample')
pssharedprivate('attachConfigComp', gcs) % Active the Polyspace Configuration.
cfg_set = getActiveConfigSet(gcs);
get_param (cfg_set, 'PSAddSuffixToResultDir')
set_param (cfg_set, 'PSAddSuffixToResultDir', 1)  % Active the option 'Make output folder name unique by adding a suffix'. This option is to add a unique suffix to the results folder for every run to avoid overwriting previous results.
You can do better and set Polyspace configuration options with 'pslinkoptions'.
For example,
bdclose all;
openExample('polyspace_code_prover/OpenModelForCodeGenerationAndPolyspaceAnalysisExample')
mlopts = pslinkoptions('polyspace_controller_demo');
mlopts.AddSuffixToResultDir = 1;  % Active the option 'Make output folder name unique by adding a suffix'. This option is to add a unique suffix to the results folder for every run to avoid overwriting previous results.
Note: The above example model is used in the following example documentation.

その他の回答 (0 件)

タグ

タグが未入力です。

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by