41. DB = drainagebasins(FD);
DB = shufflelabel(DB);
nrDB = numel(unique(DB.Z(:)))-1; % nr of drainage basins
STATS = regionprops(DB.Z,'PixelIdxList','Area','Centroid');
imageschs(DEM,DB);
hold on
for run = 1:nrDB;
if STATS(run).Area*DB.cellsize^2 > 10e6;
[x,y] = ind2coord(DB,...
sub2ind(DB.size,...
round(STATS(run).Centroid(2)),...
round(STATS(run).Centroid(1))));
text(x,y,...
num2str(round(STATS(run).Area * DB.cellsize^2/1e6)),...
'BackgroundColor',[1 1 1]);
end
end
hold off
title('drainage basins (numbers refer to drainage basin area in km^2)')
???????????????????????????
????????????????