MATLAB: Plot a 6×6 matrix in 3D

3d plotsmatrices

I want to plot A (6,6) matrix with row number as x axis, column number as y axis and the value of A(x,y) as z axis. what is the function to use?

Best Answer

N=6;
[X,Y]=meshgrid(1:N,1:N);
surf(X,Y,A);
or plot3(),contour() depending what illustration you want.
Related Question