MATLAB Answers

Generate Parameters as input to step function

14 ビュー (過去 30 日間)
Cory Mohling
Cory Mohling 2020 年 6 月 25 日
回答済み: Mark McBroom 2020 年 6 月 26 日
I'm not even sure if this is possible anymore. I was working on migrating some matlab models/autogenerated code from 2009->2019a.
It looks like they used to generate a parameters structure with format <modelName>_sl_P that would get passed in as an input to the initialize/step functions. In 2019a, I'm able to generate parameter's into the <modelName>_sl_P structure inside of the <modelName>_sl_data.cpp file.
I'm just wondering if there is anyway to force parameters to be fed in as an input to the step function rather than being accessed globally via includes?

  0 件のコメント

Sign in to comment.

回答 (1 件)

Mark McBroom
Mark McBroom 2020 年 6 月 26 日
I don't believe this is possible for C++ code gen, but is possible for C code generation. You have to place the parameters in the model workspace and mark them as model arguments as described in this link:

  0 件のコメント

Sign in to comment.

製品


リリース

R2019a

Translated by