how many input parameters to the pass function

2 ビュー (過去 30 日間)
pipor
pipor 2023 年 9 月 7 日
編集済み: Matt J 2023 年 9 月 7 日
function CalcolaButtonPushed(app, event)
app.EquityUnfilteredCheckBox.Value
app.EquityFilteredCheckBox.Value
call function (app.EquityUnfilteredCheckBox.Value,app.EquityFilteredCheckBox.Value,..
end
hi, i want to call function with a lot of parameter (app.EquityUnfilteredCheckBox.Value...)
if I write them all in the function input with app.XXX it becomes a very long line.. is there a better way to pass them to it?

採用された回答

Matt J
Matt J 2023 年 9 月 7 日
編集済み: Matt J 2023 年 9 月 7 日
Why not just pass the entire app object?
function CalcolaButtonPushed(app, event)
app.EquityUnfilteredCheckBox.Value
app.EquityFilteredCheckBox.Value
%callfunction(app.EquityUnfilteredCheckBox.Value,app.EquityFilteredCheckBox.Value,...)
callfunction(app)
end
Just because the entire object app carries more data than callfunction() might need doesn't mean callfunction() needs to use it all.
  1 件のコメント
pipor
pipor 2023 年 9 月 7 日
編集済み: Matt J 2023 年 9 月 7 日
I didn't think it could be done... thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by