assemble global stiffness matrix
Ältere Kommentare anzeigen
I am trying to assemble a matrix in which I would like to put small matrices into a big one but I don't know how to do that,
I know that I have to define the big matrix first and then show put the small ones inside
for example I have k1=[1 -1; -1 1] , K2=[1 -1; -1 1] and the define bigK in which bigK=zeros(3,3) and in the end I want it to be like bigK = [ 1 -1 0; -1 2 -1; 0 -1 1]
in which the small matrices will assemble in diagonal way
how I can do it using a for loop ?
Akzeptierte Antwort
Weitere Antworten (3)
Torsten
am 12 Okt. 2018
k1 = [1 -1; -1 1];
k2 = k1;
K = zeros(3,3)
K(1:2,1:2) = k1;
K(2:3,2:3) = K(2:3,2:3) + k2;
K
abdelrahman alhammadi
am 12 Okt. 2018
0 Stimmen
2 Kommentare
John D'Errico
am 12 Okt. 2018
Please stop adding multiple answers for every single comment!
Beck Rinks
am 25 Jul. 2022
Please only reply if you are giving answers. Thanks.
Samba Dumbuya
am 1 Dez. 2022
0 Stimmen
Hello,
I have computed the following stiffness matrix by hand;
[2/3 -1/6 -1/6 -1/3; -1/6 2/3 -1/3 -1/6;-1/6 -1/3 2/3 -1/6; -1/3 -1/6 -1/6 2/3]
Can someone please with codes that assemble the stiffness matrix into global matrix. The domain is discritize to square elemen.
thanks
1 Kommentar
Samba Dumbuya
am 1 Dez. 2022
*help me
Kategorien
Mehr zu Linear Least Squares finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!