How to tell composed functions apart?
1 次查看(过去 30 天)
显示 更早的评论
Hello, I've had a problem with plotting compositions of 4 functions.
X_air = 102.73;
X_dg = 255;
K_dg=1.459265890778872e+02;
alpha_dg=0.588240715141462;
beta_dg=0.482351856971708;
gamma_true_sk=10.591100000000000;
x_peak_sk=1.952100000000000e+02;
G_dg=76.609744634184550;
syms x;
syms y;
syms z;
syms w;
syms v;
%phi
f=((x-X_dg)/(X_air-X_dg));
%K_hom_sk
g =((1-y)*(K_dg))/((1-y)+y/(1-(alpha_dg)));
%G_hom_sk
j = ((1-y)*(G_dg))/((1-y)+y/(1-(beta_dg)));
%E_hom_sk, K_hom_sk wird zu v, G_hom_sk wird zu w
m =((9*v*w)/(3*v+w));
%ny_hom_sk
n=((3*v-2*w)/(6*v+2*w));
%probability density function
h=((1)/((pi*gamma_true_sk)*(1+((z-x_peak_sk)/(gamma_true_sk))^2)));
a = compose(h,g,f);
b = compose(h,j,f);
c = compose(h,m,j,g,f);
d = compose(h,n,g,j,f);
fplot(a);
axis([0 500 0 0.035]);
hold on
fplot(b);
hold on
fplot(c);
hold on
fplot(d);
hold on
When I try to plot all 4 of them, I get only 3 plots, so the last one, d, is missing, and I have no clue why.
Could any of you possibly tell me what might be causing this error?
Greetings, Tanja :-)
0 个评论
回答(1 个)
Manan Mishra
2018-1-10
You can't see the fourth plot because the plots for 'c' and 'd' are overlapping. You can run the "fplot" commands one by one and observe the plot for 'd' overlapping the plot for 'c'.
You can also use the "legend" commands to show legends in your plot and see the which color represents which plot.
You can run the following commands:
>> fplot(a);
>> axis([0 500 0 0.035]);
>> hold on
>> fplot(b);
>> fplot(c);
% Observe the figure before running these
>> fplot(d);
>> legend('a','b','c','d')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!