how to send a variable from input field in app designer to a function that is working as a subfunction?

31 ビュー (過去 30 日間)
Muazma Ali
Muazma Ali 2025 年 11 月 13 日 13:13
コメント済み: dpb 2025 年 11 月 13 日 17:20
Hi! :)
I have a problem:
In my small software program that I am making, I want the user to input the pressure in appdesigner and the pressure has to be input from user as it varies between 10 bar to 600 and I cant use for example a dropdownlist in a function. But my problem is that I am using the variable pressure in a subfunction some places so I dont understand how I can send it from an input field in app designer to those subfunctions..?
Any good ideas.?
  8 件のコメント
Muazma Ali
Muazma Ali 2025 年 11 月 13 日 16:34
@dpb that was difficult for me to understand: what do you mean by argument list..?
dpb
dpb 2025 年 11 月 13 日 17:20
The set (one or more) of values you need to pass to call a function
function res=myfunction(a, b, c)
res=somefunction(a,b,c);
end
Here, a, b, c are the arguments; collectively, they are the argument list.
If in your app your function(s) were to need multiple arguments besides just the one pressure you mentioned, the argument list can get long and if there's a need to change the agruments in some function later on, you have to correct both the function and the caller to match. On the other hand, with an AppBuilder app, if you were to pass the app object, then you can make all the adjustments inside it and reference anything needed directly; the argument list to the function and calling it don't need to change.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by