Hello @Anne_st, maybe the easiest is to use the 2d fields?
areas =GetAreas(md.mesh.elements2d, md.mesh.x2d, md.mesh.y2d);
that will return the areas of the elements in 2D. If you need to "extrude" the vector so that it is of size md.mesh.numberofelements
( as opposed to md.mesh.numberofelements2d
) you can do:
areas3d = project3d(md, 'vector', areas, 'type', 'element');
I hope this helps!
Mathieu