Surface area

version (2.43 KB) by Sky Sartorius
Calculate surface area and centroid of a surface or mesh.


Updated Tue, 15 Aug 2017 00:25:37 +0000

View License

[totalArea, areas, centroid] = surfarea(x,y,z)
[totalArea, areas, centroid] = surfarea(h), where h is a handle to a Surface object.

surfarea calculates the total surface area as well as returns the areas of each individual cell, along with the area centroid of the surface.
Example: Plot peaks, coloring each cell with its own area.
[x,y,z] = peaks;
[area,cellAreas,centroid] = surfarea(x,y,z);

h = surf(x,y,z,cellAreas); axis image
title(sprintf('Total surface area: %.2f', surfarea(h)));

Cite As

Sky Sartorius (2022). Surface area (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: disperse

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!