# area

Area of 2-D mesh elements

## Description

## Examples

### Area of Entire 2-D Mesh

Generate a 2-D mesh and find its area.

Create a PDE model.

model = createpde;

Include the geometry of the built-in function `lshapeg`

. Plot the geometry.

geometryFromEdges(model,@lshapeg); pdegplot(model,"FaceLabels","on")

Generate a mesh and plot it.

mesh = generateMesh(model); figure pdemesh(model)

Compute the area of the entire mesh.

ma = area(mesh)

ma = 3.0000

### Area of Individual Elements of 2-D Mesh

Generate a 2-D mesh and find the area of each element.

Create a PDE model.

model = createpde;

Include the geometry of the built-in function `lshapeg`

. Plot the geometry.

geometryFromEdges(model,@lshapeg); pdegplot(model,"FaceLabels","on")

Generate a mesh and plot it.

mesh = generateMesh(model); figure pdemesh(model)

Compute the area of the entire mesh and the area of each individual element of the mesh. Display the areas of the first 5 elements.

[ma,mi] = area(mesh); mi(1:5)

`ans = `*1×5*
0.0054 0.0054 0.0050 0.0055 0.0055

### Total Area of Group of Elements

Find the combined area of the elements associated with a particular face of a 2-D mesh.

Create a PDE model.

model = createpde;

Include the geometry of the built-in function `lshapeg`

. Plot the geometry.

geometryFromEdges(model,@lshapeg); pdegplot(model,"FaceLabels","on")

Generate a mesh and plot it.

mesh = generateMesh(model); figure pdemesh(model)

Find the elements associated with face 1 and compute the total area of these elements.

Ef1 = findElements(mesh,"region","Face",1); maf1 = area(mesh,Ef1)

maf1 = 1

Find how much of the total mesh area belongs to these elements. Return the result as a percentage.

maf1_percent = maf1/area(mesh)*100

maf1_percent = 33.3333

## Input Arguments

`mesh`

— Mesh object

`Mesh`

property of a `PDEModel`

object | output of `generateMesh`

Mesh object, specified as the `Mesh`

property of a `PDEModel`

object or as the
output of `generateMesh`

.

**Example: **`model.Mesh`

`elements`

— Element IDs

positive integer | matrix of positive integers

Element IDs, specified as a positive integer or a matrix of positive integers.

**Example: **`[10 68 81 97 113 130 136 164]`

## Output Arguments

`A`

— Area

positive number

Area of the entire mesh or the combined area of the specified elements of the mesh, returned as a positive number.

`AE`

— Areas of individual elements

row vector of positive numbers

Areas of individual elements, returned as a row vector of positive numbers.

## Version History

**Introduced in R2018a**

## MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)