I have a matrix K of dimensions n x n. I want to create a new block diagonal matrix M of dimensions N x N, such that it c
s = 'A,'; s = repmat(s,[1,n2]); s = ['B=blkdiag(', s(1:end-1),');']; eval(s);
It can be faster than using kron-eye.