From: Matt Fig on
One could also resort to an obfuscated vectorization.


B = spdiags(A,0:-1:1-size(A,1))
B = B(~fliplr(tril(ones(size(B)),-1)))