This uses the raster batch approach. Start with the same matrix as Ben:
m2 <- matrix(c( 0,1.4,3.0,4.5,6.0,7.3,8.6,9.7,10.9,12.2,13.4,14.9,16.4,18.1,20, 0,1.6,3.2,4.9,6.4,7.6,8.7,9.6,10.6,11.8,13.2,14.7,16.4,18.1,20, 0,1.7,3.5,5.2,7.0,8.3,9.0,9.4,9.9,11.1,12.7,14.6,16.3,18.2,20, 0,1.8,3.7,5.8,8.0,9.3,9.3,9.3,9.4,10.2,12.1,14.1,16.2,18.0,20, 0,1.7,3.9,6.0,8.8,9.3,9.3,9.4,9.6,9.9,11.8,14.0,16.2,18.1,20, 0,1.8,3.8,5.7,8.1,9.3,9.3,9.4,9.6,10.1,12.3,14.4,16.3,18.0,20, 0,1.6,3.5,5.2,7.0,8.4,9.1,9.5,10.1,11.3,13.0,14.6,16.4,18.2,20, 0,1.5,3.2,4.9,6.4,7.7,8.7,9.7,10.7,11.9,13.3,14.9,16.5,18.3,20, 0,1.5,3.1,4.6,6.0,7.4,8.6,9.7,10.9,12.1,13.5,15.1,16.6,18.3,20, 0,1.5,3.0,4.6,6.0,7.3,8.5,9.7,10.9,12.4,13.6,13.1,16.6,18.2,20), byrow=TRUE,nrow=10)
Convert to raster (note that transposition and general driving is because matrices start from the upper left corner, and the coordinates work from the lower right):
require(raster) require(rasterVis) r=raster(t(m2[,ncol(m2):1]), xmn=0.5,xmx=nrow(m2)+.5, ymn=0.5,ymx=ncol(m2)+0.5)
Now that Ben has hinted, you need to give him a coordinate system. At the moment, it just has the numeric coordinates of rows and columns from 1 to 10 and from 1 to 15. If it was a real-world map, then raster should know if it is long-long, or meters or feet, and X coordinates and coordinates Y are on the same scale. This is important even for data that is not displayed in the real world, as I suspect, your data.
A gradient does not make sense if your X and Y coordinates are not in the same units. If X is the resistance in ohms, and Y is the current in amperes, and Z is your measured potential in volts, then what is the bias? Well, it could be 2 V per ohm on the X axis and -3 V per amplifier in the Y direction. So what? You cannot say because you cannot combine ohms and amplifiers to get direction.
So, I proceed from the assumption that no matter what units X and Y are in your example, they are the same units (maybe they are ohms on resistor A and ohms on resistor B), and they go from 1 to 10 and 1 to 15.
Now I think that there is a projection code that simply says: βThese are the x and y coordinates without a real geographical value,β but I cannot remember what it is or find. So I just lie and use any old coordinate system that I know is a normal Cartesian grid. In this case, the National GB Network. If you tried to build this bitmap on a map, it will be a tiny square off the coast of southwest England, because where the grid takes place, and your data is 10 m by 15 m in this system:
projection(r)=CRS("+init=epsg:27700")
Let me talk to make sure we haven't messed up yet:
persp(r,theta=-50,phi=20, shade=0.23,col="red")

Note that the X and Y coordinates are in the same direction as your sample, so I know that everything is still fine.
Now I can just do a levelplot from rasterVis , but I need to do a little scaling. This is because the gradient on a real map is calculated from heights and distances that have the same units (e.g. meters or feet), but your data is just numbers. Consequently, the gradients are actually quite small in a natural integer coordinate system. So:
vectorplot(r, scaleSlope=.1)
gives you:

Note that the slope is usually downward, because the way your X and Y axes are in your example (and therefore in my raster). Also note that the cells are square because we keep the aspect ratio of the data (because we treat the X and Y coordinates as equal in measure). Ben's answer shows the general LR flow, which means that his X and Y coordinates are not in the usual order.
In addition, the gradient search algorithm in vectorplot performs some degree of smoothing, so a small gap in the upper right corner does not look as extreme as in the Ben differential algorithm:

but you need to decide if you really want to build a smooth gradient or final differences ...