title: Compiling n submatrices into an NxN matrix in numpy
body: <p>Working on a problem in matrix structural analysis. I am writing a program in Python (using Anaconda 3) to analyze a truss. Each individual truss member generates one 4x4 matrix, for a total of n 4x4 matrices. Then, these 4x4 matrices are compiled into an NxN matrix, arranged like so, for matrices A, B, C:</p>
  
  <p><a href="https://i.stack.imgur.com/wXajN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wXajN.jpg" alt="enter image description here"></a></p>
  
  <p>As you can see, each successive submatrix is placed one row over and one row down from the preceding one. Further, because the size of the truss and the number of truss joints (nodes) is specified by the user, the size of the NxN matrix has to be determined dynamically (the submatrices are always 4x4).</p>
  
  <p>I've got an NxN zero matrix; I am trying to figure out how to compile the submatrices correctly.</p>
  
  <p>I found a few similar questions but none of them scaled the larger matrix dynamically.</p>
  
  <p>I appreciate any assistance you folks can provide.</p>