UPDATE: Nevermind, I realized the k for loop would not run in this case since k = 2 > n - 1, which is why we still need to consider the 2 vertical beams afterwards.
For the pseudocode provided, let’s say n = 2. So, we’re on the first iteration of the loop.
We fill in matrix entires for
(i) the leftmost vertical member
(ii) 2 interior vertical members (inside the k for loop)
(iii) then it states the 2 rightmost vertical members. Wouldn’t these 2 rightmost vertical members be the same as the 2 interior vertical members from (ii)?
So beams 7 and 11 would be the 2 interior members and also the 2 rightmost vertical members?