I have built a 3×3 matrix using the code below
EA = 1; h = 1; F = @(xi)(xi-0.5).*(xi-0.5) k(1,1) =EA/h* 2*quad(F, -1, 1)F = @(xi)(xi-0.5).*(-2*xi)k(1,2) = EA/h* 2*quad(F, -1, 1)F = @(xi)(xi-0.5).*(xi+0.5)k(1,3) = EA/h* 2*quad(F, -1, 1)F = @(xi)(-2*xi).*(-2*xi)k(2,2) =EA/h* 2*quad(F, -1, 1)F = @(xi)(xi+0.5).*(-2*xi)k(2,3) = EA/h*2*quad(F, -1, 1)F = @(xi)(xi+0.5).*(xi+0.5)k(3,3) = EA/h*2*quad(F, -1, 1)k(2,1) = k(1,2)k(3,1) = k(1,3)k(3,2) = k(2,3)
I want to use the 3×3 matrix above to create a 21×21 matrix following the pattern below
the overlapped elements should be added together, the numbers not in the 3×3 matrix are zero in the bigger matrix…k(4,1)=0 etc..
10 3×3 matrices should be used
I want to use a for loop unless there's another method
Best Answer