mixing 16 matrixs in 48 lines
1 view (last 30 days)
Show older comments
here is my code. the results is mixing 16 matrixs together. how to separate those matrixs one by one?
clc
clear all
ea1=147;
ea2=10.3;
va12=0.27;
ga12=7;
va21=(va12/ea1)*ea2;
qa11=ea1/(1-va12*va21);
qa12=(va12*ea2)/(1-va12*va21);
qa22=ea2/(1-va12*va21);
qa66=ga12;
[Qa]=[qa11 qa12 0 ;qa12 qa22 0 ;0 0 qa66];
th=[0:0.1:pi/2.0];
n20=sin(th);
m20=cos(th);
h2i=0.125;
z21=[-0.0625:0.125:0.0625];
q2i11bar=qa11.*m20.^4+2*(qa12+2*qa66).*n20.^2.*m20.^2+qa22.*n20.^4;
q2i12bar=(qa11+qa22-4*qa66).*n20.^2.*m20.^2.+qa12.*(n20.^4.+m20.^4.);
q2i22bar=qa11.*n20.^4.+2*(qa12+2*qa66).*n20.^2.*m20.^2.+qa22.*m20.^4.;
q2i16bar=(qa11-qa12-2*qa66).*n20.*m20.^3.+(qa12-qa22+2*qa66).*n20.^3.*m20;
q2i26bar=(qa11-qa12-2*qa66).*m20.*n20.^3.+(qa12-qa22+2*qa66).*m20.^3.*n20;
q2i66bar=(qa11+qa22-2*qa12-2*qa66).*n20.^2.*m20.^2.+qa66*(n20.^4+m20.^4);
[Q2ibar]=[q2i11bar q2i12bar q2i16bar;q2i12bar q2i22bar q2i26bar;q2i16bar q2i26bar q2i66bar]
So how to separate ?
0 Comments
Answers (1)
KALYAN ACHARJYA
on 12 Oct 2019
Edited: KALYAN ACHARJYA
on 12 Oct 2019
After the code, you can add the following to extract the 3x6 sub 16 matrices from Q2ibar, and save them all in cell array mat, which allows you to easily call any sub matrices from the 16 matrices, if looking for 1st sub matrics then just type mat{1} in the command window.. so on... mat{2}....
mat=cell(1,16);
l=0;
for i=1:16
mat{i}=Q2ibar(:,1+l:3*i)
l=l+3;
end
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!