Formulate the stiffness matrix of the bar finite element in 3D. Then, write a Matlab code that generates the global stiffness matrix for a structure made of 10 elements.