Error using plotyy in for loop

1 回表示 (過去 30 日間)
Anees khan
Anees khan 2016 年 2 月 21 日
コメント済み: Anees khan 2016 年 2 月 24 日
i am trying to plot a graph in a for loop using hold on command. When i use simple plot (x,y) command graphs works well. But when i use plotyy command the same values the graph get distorted. Please guide
E1=30e6;
E2=.75e6;
G12=0.375e6;
v12=0.25;
hold on
for x=0:0.5:90
Ex=1/((1/E1*cosd(x).^4)+((1/G12-2*v12/E1)*(sind(x).^2)*(cosd(x).^2))+(1/E2*sind(x).^4));
vxy=Ex*(v12/E1*(sind(x).^4+cosd(x).^4)-(1/E1+1/E2-1/G12)*sind(x).^2*cosd(x).^2)
plotyy (x,Ex/E2,x,vxy)
end
hold off

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 2 月 21 日
E1=30e6;
E2=.75e6;
G12=0.375e6;
v12=0.25;
x=0:0.5:90
Ex=1./((1./E1*cosd(x).^4)+((1./G12-2*v12/E1).*(sind(x).^2).*(cosd(x).^2))+(1./E2*sind(x).^4))
vxy=Ex.*(v12./E1.*(sind(x).^4+cosd(x).^4)-(1/E1+1/E2-1/G12).*sind(x).^2.*cosd(x).^2);
plotyy (x,Ex/E2,x,vxy)
  1 件のコメント
Anees khan
Anees khan 2016 年 2 月 24 日
Thanks Alot! :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by