How to change mask popup Type Options using callback code?

10 ビュー (過去 30 日間)
Dan Floyd
Dan Floyd 2019 年 10 月 3 日
回答済み: Dan Floyd 2019 年 10 月 5 日
I have created a mask for my system that allows a user to select a specific value from a popup window (the parameter name of the value is TypeIn). I am then attempting to use this value to display a specific set of type options in another popup window in the same mask. I am trying to use the Callback section to enact these changes but I am unable to get the type options to change. The callback code I am using is:
P = Simulink.Mask.get('therm/TC');
RangeCtrl = P.Parameters(1);
if RangeCtrl == 1
RangePar = P.Parameters(2)
RangePar.TypeOptions = {'Option1' 'Option2'}
end
I am unsure how to correct this error and have not been able to find other answers or documentation on this specific problem.

採用された回答

Dan Floyd
Dan Floyd 2019 年 10 月 5 日
I found the solution. It was returning an object (RangeCtrl) and not the desired value (TypeIn), therefore making my if statement useless.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Environment Customization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by