How to change the record name of Run-Time Parameter with Level 2 MATLAB S-Function in model.rtw
1 次查看(过去 30 天)
显示 更早的评论
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')))
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!