Using helper function for multiple callbacks in appdesigner

4 ビュー (過去 30 日間)
Karthik  Vemireddy
Karthik Vemireddy 2018 年 5 月 29 日
編集済み: Karthik Vemireddy 2018 年 6 月 5 日
Hi,
I would like to update the limits of a numeric field (Max Value), when the value of another numeric field (min Value) changes.
I have multiple min & max value numeric filed sets. I want to create a helper function that would do the above job, when I pass on the component and event information.
Is it possible? If yes, can someone help me out with it? I'm using matlab 2016b
Thanks and Best Regards
Karthik

採用された回答

Karthik  Vemireddy
Karthik Vemireddy 2018 年 6 月 5 日
編集済み: Karthik Vemireddy 2018 年 6 月 5 日
I have figured it out and its quite simple. All you need to do is, pass the component as input argument.
function HelperFcn(app, Component)
Selvalue= Component.Value;
end
In the function, you can access the elements of the component through the passed variable.
use
SelVal=Component.value;
instead of
SelVal=app.listbox.value;
HTH!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by