Borrar filtros
Borrar filtros

Error using plotyy in for loop

1 visualización (últimos 30 días)
Anees khan
Anees khan el 21 de Feb. de 2016
Comentada: Anees khan el 24 de Feb. de 2016
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

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 21 de Feb. de 2016
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)

Más respuestas (0)

Categorías

Más información sobre Two y-axis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by