필터 지우기
필터 지우기

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)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by