MATLAB: How do i combine the stiffness matrix for a rectangular mesh with 100 elements.

stiffness matrix combination

traker=[2*Connectivity(i,1)-1 2*Connectivity(i,1) 2*Connectivity(i,2)-1 2*Connectivity(i,2) …
2*Connectivity(i,3)-1 2*Connectivity(i,3) 2*Connectivity(i,4)-1 2*Connectivity(i,4)];
Kg(traker,traker) = Kg(traker,traker)+kel
This is the procedure i have adopted for combining the stiffness matrix for a rectangular plate with rectangular element.
The connectivity matrix here containes the node number for four end of each element. Is this the correct way to do? i am having problem in analyzing the plate element . somebody please help. thhanks