For mathematical functions or topological data, a 3D surface plot is preferred. This interprets the matrix values as height ($z$-axis).
Free PDF Guide: "MATLAB Matrix Plotting: From NxN Data to Publication-Ready PDF"
To create an nxn matrix in MATLAB, you can use the following methods:
n = 50; matrixData = magic(n); % Creates a classic mathematical square matrix imagesc(matrixData); colormap(jet); % Changes the color scheme colorbar; saveas(gcf, 'matlab_matrix_plot.pdf'); disp('Your PDF has been created in the current folder.'); Use code with caution.