how can i change the for loop in this program..?

9 ビュー (過去 30 日間)
an
an 2014 年 3 月 16 日
コメント済み: an 2014 年 3 月 27 日
r=10
P1=10^9 w1=4.55 w2=5.13 h=8; for x=1;2;3;4;5;6;7;8;9;10; d= 20.*x end w=d; d0=0.4 B1=(d./d0).^(1./3) s=d./r; A1=d.^2 E0=8.85*10^-12 b=6.830890 E1=b.*w1.^1.5 E1g=b.*w2.^1.5 E2=E1./B1
E2g=E1g./B1 c=E2.*d./B1 cg=E2g.*d./B1 x=0.5.*E0.*E2.^2.*10^18 xg=0.5.*E0.*E2g.^2.*10^18 A2=A1.*(x./P1) A2g=A1.*(xg./P1) v1=d.*A1 v=(d+h).*(A1+A2) vg=(d+h).*(A1+A2g) u=x.*(v1./v) ug=xg.*(v1./vg) plot(d,u,'green') hold plot(d,ug,'red') hold
  3 件のコメント
an
an 2014 年 3 月 27 日
r=10
P1=10^9 w1=4.55 w2=5.13 h=8; for x=1;2;3;4;5;6;7;8;9;10; d= 20.*x end w=d; d0=0.4 B1=(d./d0).^(1./3) s=d./r; A1=d.^2 E0=8.85*10^-12 b=6.830890 E1=b.*w1.^1.5 E1g=b.*w2.^1.5 E2=E1./B1
E2g=E1g./B1 c=E2.*d./B1 cg=E2g.*d./B1 x=0.5.*E0.*E2.^2.*10^18 xg=0.5.*E0.*E2g.^2.*10^18 A2=A1.*(x./P1) A2g=A1.*(xg./P1) v1=d.*A1 v=(d+h).*(A1+A2) vg=(d+h).*(A1+A2g) u=x.*(v1./v) ug=xg.*(v1./vg) plot(d,u,'green') hold plot(d,ug,'red')

サインインしてコメントする。

採用された回答

Roger Stafford
Roger Stafford 2014 年 3 月 16 日
In place of your for-loop you can have:
d = 20*[1:10].';
or
d = linspace(20,200,10);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by