App Designer, how to use value of DropDown in external function file
Show older comments
Hello everyone, currently I am working on App Designer and need to use the DropDown item in order to be able to select which expression I want the calculations to proceed with. I have created a separate .m file which involves an if statement. If the DropDown value (Type) equals 1, do this expression, if it equals 2, then this other. I am getting the following error "Output argument "Rad_fin" (and maybe others) not assigned during call to "OgiveTypeAPP"". I call the outputs on app designer as follows:
[Rad_fin,Rad_tip,Rad_rear,Rad] = OgiveTypeAPP(dist_fin,DIST_tip,DIST_rear,DIST); %All inputs are specified on the app.
On app desginer I have stored the value of the dropdown as:
global Type; Type = app.DropDown.Value;
Below is a screenshot of the settings for the drop down and the external .m function I am using.
function [Rad_fin,Rad_tip,Rad_rear,Rad] = OgiveTypeAPP(l,m,n,o)
global Rmax
global L
global Type
if Type == 1
Rad_fin = Rmax*sqrt(l/L);
Rad_tip = Rmax*sqrt(m/L);
Rad_rear = Rmax*sqrt(n/L);
Rad = Rmax*sqrt(o/L);
elseif Type == 2
Rad_fin = Rmax*(l/L).^(0.75);
Rad_tip = Rmax*(m/L).^(0.75);
Rad_rear = Rmax*(n/L).^(0.75);
Rad = Rmax*(o/L).^(0.75);
end
end

Accepted Answer
More Answers (0)
Categories
Find more on Develop Apps Using App Designer 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!