Get left and right side argument trying to execute this code, any suggestions on how to fix it?

1 visualización (últimos 30 días)
close all;
clear all;
% Material Properties of Boron/Epoxy composite
E1 = 30*10^6;
E2 = 3*10^6;
G12 = 1*10^6;
v12 = .3;
v21 = v12*(E2/E1);
% setting the zeros for the functions
figure
hold on;
theta = linspace(0,90,18);
Ex = zeros(size(theta));
Gxy = zeros(size(theta));
vxy = zeros(size(theta));
nxyx = zeros(size(theta));
% defining the functions
for i=1: length(theta)
theta(i)
[Ex(i)] = Ex_lon(E1,E2,G12,v12,theta(i));
[Gxy(i)] = Gxy_lon(E1,E2,G12,v12,theta(i));
[vxy(i)] = vxy_lon(Ex E1,E2,G12,v12,theta(i));
[nxyx(i)] = nxyx_lon(Ex E1,E2,G12,v12,theta(i));
end
% generating the plot
plot(theta,Ex/E2,'-+r',theta,Gxy/G12,'-*g',theta,vxy,'-^b',theta,nxyx,'-xk');
xlabel('\theta (degree)');
yyaxis left;
ylabel('E_x/E_2, Gxy/G12, -nxyx');
yyaxis right;
ylabel('vxy');
legend('E_x/E_2','Gxy/G12','vxy','-nxyx');
hold off
% the following are the functions that the previously defined functions are
% called to
function [Ex] = Ex_lon(E1,E2,G12,v12,theta)
E_inv = (1/E1)*(cosd(theta)^4) + (1/G12- 2*v12/E1)*(sind(theta)^2)*(cosd(theta)^2) + (1/E2)*(sind(theta)^4);
Ex = (1/E_inv);
end
function [Gxy] = Gxy_lon(E1,E2,G12,v12,theta)
Gxy_inv = 2*(2/E1 + 2/E2 + 4*v12/E1 - 1/G12)*(sind(theta)^2)*(cosd(theta)^2)+ 1/G12*((sind(theta)^4)+(cosd(theta)^4));
Gxy = 1/Gxy_inv;
end
function [vxy] = vxy_lon(Ex,E1,E2,G12,v12,theta)
vxy = Ex*(v12/E1 * (sind(theta)^4)*(cosd(theta)^4)-(1/E1 + 1/E2 - 1/G12)*(sind(theta)^2)*(cosd(theta)^2));
end
function [nxyx] = nxyx_lon(Ex E1,E2,G12,v12,theta)
nxyx = Ex*((2/E1 + 2/E2 - 1/G12)*(sind(theta))*(cosd(theta)^3)-(2/E2 +2*v12/E1 - 1/G12)*(sind(theta)^3)*(cosd(theta)));
end
  7 comentarios

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Programming 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