# i want to extract a matrix from a cell array that consists on a number of 3x3 matrices

1 view (last 30 days)
Mahmoud Chawki on 16 May 2022
Commented: Stephen23 on 16 May 2022
i want to extract a matrix from a cell array that consists on a number of 3x3 matrices
clc
clear all
%Given lamina unidirecton properties E1, E2, G12,v12
n=3;
t= 5; %Ply thickness mm
h=n*t; %thickness of the laminate
E1= 181; %GPA
E2= 10.3; %GPA
G12= 7.17; %GPA
V12= 0.28; %poisson ratio
Nx= 1; %Mpa.mm
Ny= 1; %Mpa.mm
Nxy= 0; %Mpa.mm
Mx= 0;
My=0;
Mxy=0;
Force_vec=[Nx; Ny; Nxy; Mx; My; Mxy];
%Determine stresses and strains in each ply
%First step find Q matrix
tetha=[0 30 -45];
c=cosd(tetha);
s=sind(tetha);
%S matrix calculation
S=[1/E1 -V12/E1 0;-V12/E1 1/E2 0;0 0 1/G12];
%Q matrix calculation
Q=inv(S);
for i=1:numel(tetha)
%Transformation matrix calculation
T{i}=[c(i).^2 s(i).^2 2.*s(i).*c(i); s(i).^2 c(i).^2 -2.*s(i).*c(i); -s(i).*c(i) s(i).*c(i) (c(i).^2)-(s(i).^2)];
%Inverse of the transformation matrix
T_1{i}=inv(T{i});
%R matrix
R{i}=[1 0 0; 0 1 0; 0 0 2];
R_1{i}=inv(R{i});
%S bar matrix calculation
Sbar{i}=R{i}*T_1{i}*R_1{i}*S*T{i}; %results are in 1/GPA
%Q_bar matrix calculation
Qbar{i}=inv(Sbar{i});
end
i want to extract each matrix and save it alone from Qbar which consists of an array of matrices
Stephen23 on 16 May 2022
"I mean extract a matrix from Qbar and assign to a value."
The word "extract" does not have a common MATLAB meaning. So I am asking you what you expect to happen, so that we can help you. Consider this simple example:
Qbar = {[11,12;13,14],[21,22;23,24],[31,32;33,34]}
Please show the expected output given this Qbar.

### Categories

Find more on Matrices and Arrays 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!

Translated by