how to send a variable from input field in app designer to a function that is working as a subfunction?
31 views (last 30 days)
Show older comments
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 Comments
dpb
on 13 Nov 2025 at 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.
Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!