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 日間)
古いコメントを表示
Omorodion Solomon
2021 年 9 月 19 日
コメント済み: Walter Roberson
2021 年 9 月 20 日
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()
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/743424/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/743429/image.jpeg)
0 件のコメント
採用された回答
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)
0 件のコメント
その他の回答 (1 件)
Omorodion Solomon
2021 年 9 月 20 日
1 件のコメント
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()
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!