Clear Filters
Clear Filters

Getting two element for a single call of element from a matrices

1 view (last 30 days)
In below mentioned codes, i wrote compliance (S) matrice and inverse this matrix to get the stiffnes matrice(Q). I write all of this code with a variable theta 'th'.
Now i want to plot vxy which is having relation with one of the element of matrice(Q), when i called the element S(1:2) it is showing two element. So matrice dimention are not satifying for plot. Also some problem with Gxy.
syms th
E1=181*10^9;
E2=10.30*10^9;
v12=0.28;
G12=7.17*10^9;
s11=1/E1;
s21=-v12/E1;
s13=0;
s12=s21;
s22=1/E2;
s23=0;
s66=1/G12;
s=[s11 s12 s13;s21 s22 s23;0 0 s66]; %s is compliance matrix in priciple coordinate
q=inv(s); %q is stiffness matrix in priciple coordinate
T=[cosd(th).^2, sind(th).^2, 2*sind(th)*cosd(th); sind(th).^2, cosd(th).^2, -2*sind(th)*cosd(th);-sind(th)*cosd(th), sind(th)*cosd(th), cosd(th).^2-sind(th).^2];
R=[1 0 0;0 1 0;0 0 2];
Q=inv(T)*q*R*T*inv(R) %Q is stiffness matrix in other then fiber coordinate
S=inv(Q) %S is compliance matrix in other then fiber coordinate
Ex=(1./(S(1:1)));
Ey=(1./(S(2:2)));
vxy=-Ex.*S(2:1)
vyx=-Ey.*S(1:2)
Gxy(th)=(1./(S(3:3)))
th=-90:1:90;
% Ex1 =vpa(Ex(th));
% plot(th,Ex1,'r')
%
% Ey1=vpa(Ey(th));
% plot(th,Ey1,'g')
vyx1=vpa(vyx(th))
plot(th,vyx1,'b')

Answers (1)

deepak maurya
deepak maurya on 26 Jan 2019
Hello friends
I done the mistake of calling of element,
i was calling row and column instead of element.
I was using (:) colon in place of (,)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!