Use the rowgrad and colgrad functions to create row and column differences in an image matrix by subtracting successive rows (or columns) from each other. In each case the resulting matrix has one undefined row or column that is set to zero.
These functions find the row and column gradients of an image matrix resulting in a horizontally or vertically selective edge detection. Edge detection is used to enhance image readability for certain types of features that depend on boundaries. Gradients also result in a visual embossing effect.
The rowgrad function subtracts adjacent rows in an image matrix to form the output matrix. The first row is zero.
The colgrad function subtracts adjacent columns in an image matrix to form the output matrix. The first column is zero.