numel

Returns the number of elements in x.

Syntax

numel(x)

Inputs

x
Any valid input.
Type: double | integer
Dimension: scalar | vector | matrix

Outputs

R
Number of elements.

Example

Simple numel example.

a = [ 1 2 3 4 5 6]
R = numel(a)
R = 6