MATLAB: How to shuffle matrix entries using MATLAB

shuffle matrix elements

Let's suppose I have a 2by2 matrix. I need a code which gives me the matrices with same elements but at different positions e.g., for 2by2 matrix, 2^4 different combinations can be generated.

Best Answer

perhaps a modification based on the sample code showing use of perms?
Related Question