Plotting a multivariable function
Show older comments
Hi, I have a multivariable function as you can see down below. The function works perfect but I have a problem. I need to plot v_cal - v_true when a_ft is equal to 28000. However, when I tried to run the function, MATLAB asks me for v_cal and a_ft values. When I input these values, it plots the v_cal-v_true graph as a constant function. How can I fix this? Thanks in advance.
function v_true=CaltoTrue(a_ft,v_cal)
a=a_ft*0.3048;
b=-0.0065;
R=287.05287;
gr_0=9.80665;
p0=101325;
T0=288.15;
pr=p0*((T0+b*a)/T0)^(-gr_0/(b*R));
T=T0+b*a;
ad=pr/(R*T);
k=1.4;
nu=(k-1)/k;
ad_0=1.225;
v_true=(((((1+(nu*ad_0*(v_cal)^2)/(2*p0))^(1/nu)-1)*p0/pr+1)^nu-1)*(2*pr)/(nu*ad))^(1/2);
if a_ft==28000
v_cal=0:500;
fplot(v_true)
xlabel('V_Cal')
ylabel('V_True')
end
end
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots 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!
