Please someone help me correct my code. I want to plot a 2D graph for distinct alpha in one single 2D plot. See the attached photo for the guidience

1 次查看(过去 30 天)
alpha=[0.7, 0.8,0.9,1];
P=1;
t=0.5;
s=[-5:0.2:5];
A=(1-s.^2)+((P-4).*(t.^alpha))./(gamma(alpha+1));
Plot(s,A,'-r');
xlabel('x')
ylabel('u')
legend()

采纳的回答

Walter Roberson
Walter Roberson 2021-9-19
alpha=[0.7, 0.8,0.9,1];
P=1;
t=0.5;
s = (-5:0.2:5).';
A=(1-s.^2)+((P-4).*(t.^alpha))./(gamma(alpha+1));
plot(s,A);
xlabel('x')
ylabel('u')
legend( "\alpha = " + alpha)

更多回答(1 个)

Omorodion Solomon
Omorodion Solomon 2021-9-20
Thank you so much. Lastly, Please how can I apply same to plot this?
  1 个评论
Walter Roberson
Walter Roberson 2021-9-20
For finite cases:
m = (1:2:2*n-3).';
urt = r + sum(prod(m.^2)./r.^(2*n-1) .* t.^(alpha .* n) ./ gamma(alpha .* n + 1),1)
for infinite upper bound you would need to use symsum() and symprod()

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by