How to change the record name of Run-Time Parameter with Level 2 MATLAB S-Function in model.rtw

1 view (last 30 days)
I use Level 2 MATLAB S-Function masked with 4 parameters to generate code as following steps:
1.Set 4 Turnable Parameters as Run-Time Parameters in Leve 2 MATLAB S-Function.
% Register paramter
block.NumDialogPrms =4;
block.DialogPrmsTunable = {'Tunable','Tunable','Tunable','Tunable'};
%
function ProcessPrms(block)
block.AutoUpdateRuntimePrms;
%endfunction
%
function DoPostPropSetup(block)
%Register all tunable parameters as runtime parameters.
block.AutoRegRuntimePrms;
%endfunction
2.Record of Run-Time Parameters in model.rtw like this:
Parameters [4, 4]
Parameter {
Name " MSFcnParameter1"
ASTNode {
IsNonTerminal 0
Op SL_INLINED
ModelParameterIdx 0
}
Value [1.0]
ContainerCGTypeIdx 19
String "FcnSel"
StringType "Expression"
}
  • Q1:The question is that how can I change the recoord name "MSFcnParameter1" to "FcnSel"?
  • Q2:When I change the value of Non-Turnable Parameter and regenerate code, I must input the following command-line in Command Window or delete the slprj folder. Otherwise, the build process will omit regeneration. (It is a bit troublesome.)
rtwbuild('MFcn_model','ForceTopModelBuild',ture)
(web(fullfile(docroot, 'rtw/ug/control-regeneration-of-top-model-code.html')))

Answers (0)

Categories

Find more on 代码生成 in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!