I am designing a GUI for calculating weight and wing loading of an aircraft. But when I am executing the below code I am getting an error that states “ Values must be a double sclar within the range of limits”. I have attached an image showing the exact line where this error is occuring. Any help to resolve this issue is highly appreciated.
h=app.AltitudehinkmEditField.Value;v=app.FlightvelocityinmsEditField.Value;m=app.MassoftheAircraftinkgEditField.Value;s=app.WingAreainm2EditField.Value;ar=app.AspectRatioEditField.Value;e=app.OswaldsEfficiencyFactoreEditField.Value;if h<11 tratio=(1-(h/44.331)); d=1.225*(tratio)^4.256; endif h==11 d=0.36392endif h>11 d=0.036392*exp((-9.80665*([h*1000]-11000))/(287.05287*216.65)); end q=0.5*d*1.225*v^2; k=1/(3.14*ar*e) w=9.81*m; wl=w/s; app.Densityinkgm3athkmEditField.Value=d; app.WeightofTheAircraftinkgEditField.Value=w; app.Wingloadinginkgm2EditField.Value=wl; app.DynamicPressureinPaEditField.Value=q; app.KEditField.Value=k;rc(app,h,v,m,s,ar,e)
Best Answer