mixing 16 matrixs in 48 lines

1 view (last 30 days)
JIAHENG ZHU
JIAHENG ZHU on 12 Oct 2019
Commented: JIAHENG ZHU on 12 Oct 2019
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 ?d5ec8b6b2cfc4bd26af76a11256a1aa.png

Answers (1)

KALYAN ACHARJYA
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
  1 Comment
JIAHENG ZHU
JIAHENG ZHU on 12 Oct 2019
Hi Thank you very much
A2i=[mat{i}]*(z21(2)-z21(1))
A2i2=inv(A2i);
D=1/(h2i*A2i2(1,1));
E21i=D/ea2;
figure
plot(th,E21i,'LineWidth',2)
xlabel('\theta (rad)');
ylabel('Ex/E2','Interpreter','Latex');
set(gca,'FontSize',16);
RFS@})_0YHF`$87BKHC7VZY.png
here is my follow code, now i can separate each matrix one by one.
but when i try to use those data to make a figure with mat{i}, I found that only one matrix for mat{i}. So how to figure that one ? THANKS

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!