How to Programmatically Disable the "Tunable" Option for a Matlab Funcion Block Parameter

조회 수: 7 (최근 30일)
I'm trying to use a script to build a Simulink model with a "Matlab Function Block" in it. The method here works great to make the block. I want to use Parameter inputs to load data files into the function that only need to be loaded at the begnnning of the simulation. To do this, I use "Parameter" inputs to the function. The method here works to make inputs defined in the script as Parameters. However, I need to make these parameters non-tunable in order for the model to be able to run properly, but the default is for them to be tunable. I can't find any method in the Stateflow.EMChart object for the block or the Stateflow.Data object for the parameter itself that will let me disable that option.
Anyone seen this before?
Thanks,
Greg

채택된 답변

Kaustubha Govind
Kaustubha Govind 2013년 4월 4일
This should work:
set(ins, 'Scope', 'Parameter', 'Tunable', false);
  댓글 수: 2
Greg
Greg 2013년 4월 4일
Wow, that's so simple I feel silly for not having tried it.
Would be handy if more of these parameters were visible, though! Documentation on all these underlying Simulink and Stateflow classes would be even better.
Frank
Frank 2020년 3월 19일
편집: Frank 2020년 3월 19일
I think the answer is a little outdated now. What's the new syntax to make the parameter of embedded MATLAB code tunable programmatically? Let's say I have a block path, or a block handle, to start with.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by