"I want to to crop the heatmap manually by using a binary mask (createMask, drawpolygon) to extract important parts."
This won't be possible (as of r2019b). If drawpolygon() is called on a heatmap axis, you'll get the error "Polygon cannot be a child of HeatmapChart." Use imagesc() instead of heatmap.
"My question is, if it is possible to set all the values of matrix zero on the basis of the black coloured parts of the heatmap."
Here's a demo how to create a heatmap using imagesc(); how to define a region of interest using drawpolygon(), and how to set the color of units outside of the polygon to black.
fig = figure()
data = randi(100,10,15);
x = 1:size(data,2);
y = 1:size(data,1);
hm = imagesc(x,y,data);
axis equal
pg = drawpolygon();
pos = pg.Position;
[allx,ally] = meshgrid(x,y);
[in,on] = inpolygon(allx,ally,pos(:,1),pos(:,2));
hm.CData(~(in|on)) = 0;
ax = gca();
ax.Colormap(1,:) = [0 0 0];