What's wrong with my code?
古いコメントを表示
here's my code..
syms a
b=2; e=0.9; q=0.4; g=0.6; k=0; d=0.5;
a=1:1:5;
N(a) = (q*b*e/a-d*e)/((q^2)*(e^2)/a+2*e*g)
pi(a)=(b-q*N*e)/a
m=N(a)
n=pi(a)
plot (a,N(a),'b')
hold on
plot (a, pi(a),'red')
When I run it, it gives me these errors.
Error using /
Matrix dimensions must agree.
Error in sev (line 31)
N(a) = (q*b*e/a-d*e)/((q^2)*(e^2)/a+2*e*g)
When I use "./", it plots only pi, but N is on x axis fixed at 0, what can I do to make it work?
採用された回答
その他の回答 (1 件)
madhan ravi
2020 年 6 月 6 日
Naming a variable pi is a bad idea
doc pi
3 件のコメント
Ani Asoyan
2020 年 6 月 6 日
madhan ravi
2020 年 6 月 6 日
a=1:5 should be after N(a)... and implying ./
Ani Asoyan
2020 年 6 月 6 日
カテゴリ
ヘルプ センター および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
