I have 'n' number of two dimensional(square) matrices. I have stored them as stack in a single three dimensional matrix. How can I perform series of matrix multiplication from 1 to n matrices without explicitly writing the whole line?
T(:,:,1) = a;
T(:,:,2) = b;
T(:,:,3) = c;
ans = T(:,:,1)*T(:,:,2)*T(:,:,3);