MATLAB: How to display elements of a 2D matrix as color-coded squares

plotting

like for a 16×16 matrix:

Best Answer

imagesc(your_matrix)