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)
Error using plotyy in for loop
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Azzi Abdelmalek
2016-2-21
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Two y-axis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!