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)
function DoPostPropSetup(block)
%Register all tunable parameters as runtime parameters.
2.Record of Run-Time Parameters in model.rtw like this:
Parameters [4, 4]
Parameter {
Name " MSFcnParameter1"
ASTNode {
IsNonTerminal 0
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.)
(web(fullfile(docroot, 'rtw/ug/control-regeneration-of-top-model-code.html')))


Community Treasure Hunt

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

Start Hunting!