Home > custom > grid_stats > fastslope.m

fastslope

PURPOSE ^

calculate slope (deg) using GRADIENT function

SYNOPSIS ^

function grad = fastslope(dem,X,Y)

DESCRIPTION ^

 calculate slope (deg) using GRADIENT function

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function grad = fastslope(dem,X,Y)
0002 % calculate slope (deg) using GRADIENT function
0003 dx=abs(X(2)-X(1));  % get cell spacing in x and y direction
0004 dy=abs(Y(2)-Y(1));  % from coordinate vectors
0005 [fx,fy] = gradient(dem,dx,dy); % uses simple, unweighted gradient of immediate neighbours
0006 [asp,grad]=cart2pol(fy,fx); % convert to carthesian coordinates
0007 grad=atand(grad); %steepest slope

Generated on Tue 24-Feb-2009 19:14:50 by m2html © 2003