MATLAB: Use of kron with more than two matricies

kronMATLABmatriciesmatrixtoo many input arguments

I have four 4×4 matricies called: ox, ru, cr, po.
I have been successful in using the Kronecker tensor product for two of the matricies, I being a 4×4 identity matrix.
mat = kron(I,ox) + kron(ru,I);
However, when I try doing the same with all four matricies…
mat = kron(I,I,I,ox) + kron(I,I,ru,I) + kron(I,cr,I,I) + kron(po,I,I,I);
I get an error saying 'Too many input arguments.'
Is here a way to achieve the result for four matricies?
Thank you.

Best Answer

One way would be to use my KronProd class
as follows,
kp=@(A,B,C,D) sparse(KronProd{D,C,B,A});
mat = kp(I,I,I,ox) + kp(I,I,ru,I) + kp(I,cr,I,I) + kp(po,I,I,I);