MATLAB: How to find X and Y coordinates of a matrix

coordinatesMATLABmatrix

Lets assume the following matrix A.
A = [1 2 3
4 5 6
7 8 9];
Now I want to know the X and Y coordiantes of matrix A. Also, my origin is at 7 (i.e. from bottom left corner). My X-coordinate range is 0 to 25 and Y-coordinate range is 0 to 10.
Thanks in advance.

Best Answer

A = [1 2 3
4 5 6
7 8 9];
[nx,ny] = size(A) ;
x = linspace(0,25,ny) ;
y = linspace(0,10,nx) ;
[X,Y] = meshgrid(x,y) ;
pcolor(X,Y,A)