how many input parameters to the pass function
1 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!