The elements of the meshed are numbered randomly. You can get the coordinates of the center by doing mean(md.mesh.x(md.mesh.elements(i,:))) and same for y. You can also use the following plotmodel options:
plotmodel(md,'data','elementnumering');
plotmodel(md,'data','hilightelements','highlight',); %To highlight elements 1 2 and 3
For the estimate a derivative, the best is to look at what we do in slope.m (we use P1 nodal functions). If you want to estimate the bed slopes with a 2d model, you can do this:
bed = md.geometry.base;
=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
summation=;
bx=(bed(md.mesh.elements).*alpha)*summation;
by=(bed(md.mesh.elements).*beta)*summation;
b=sqrt(bx.^2+by.^2);