MATLAB: Is there any way that I Add a fourth row value to a find out 3×1 matrix

gsm

Do any one knows is there any way that I can Add a fourth row value to a find out 3×1 matrix?
Add a zero as a fourth member to the vector you found in Part G. This represents the fact that Node 4 does not move. Assign your new four element column vector: displacements the same name given as the first output vector for your function.
The previous code that I type
%step 2 Local Behavior
% Form local stiffness Matrixes
E1 = [k1 -k1 ; -k1 k1];
E2 = [k2 -k2 ; -k2 k2];
E3 = [k3 -k3 ; -k3 k3];
%Step 3
%Assemble Global Stiffness Matrix (GSM)
GSM = zeros(4,4);
GSM(1:2,1:2) = GSM(1:2,1:2) + E1;
GSM(2:3,2:3) = GSM(2:3,2:3) + E2;
GSM(3:4,3:4) = GSM(3:4,3:4) + E3;
%Step 4
%Apply Boundary Conditions
external_F1 = [60 ; 0 ; 0 ];
mini_GSM = GSM (1:end-1 ,1:end-1);
% Step 5
%solve for unknown displacements
mini_U = mini_GSM \ external_F1;
%step 6
% Analyze and find Reaction Forces
mini_U =
Which mini_GSM is a 3×3 matrix and I have built my external_F1 be 3×1, after I solve, I got mini_U as a 3×1 matrix, but can I just add a fourth row to the mini_U be zero? Thank you

Best Answer

mini_U(4,:) = 0