Summing multiple variables and plotting them.
古いコメントを表示
Does anyone know how I might sum and plot the variables I have listed in my code?
Here is my code:
L = 1;
x = 0:L;
psi1 = sqrt(2/L)*sin((pi*x)/L);
psi3 = sqrt(2/L)*sin((pi*x)/L)-sqrt(2/L)*sin((3*pi*x)/L);
psi5 = sqrt(2/L)*sin((pi*x)/L)-sqrt(2/L)*sin((3*pi*x)/L)+sqrt(2/L)*sin((5*pi*x)/L);
psi7 = sqrt(2/L)*sin((pi*x)/L)-sqrt(2/L)*sin((3*pi*x)/L)+sqrt(2/L)*sin((5*pi*x)/L)-sqrt(2/L)*sin((7*pi*x)/L);
A = sum(psi1,psi3,psi5,psi7);
plot ((A),x,0,L)
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で 2-D and 3-D Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!