Generate Parameters as input to step function

조회 수: 6 (최근 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?

답변 (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:

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by