Main Content


Number of elements in an array and subarray

Since R2023b



N = getNumElements(array) returns the number of elements N in the array.

NS = getNumElements(array,m) returns the number of elements NS in the mth subarray of the array.


collapse all

Create a UCA with the default number of elements. Verify that there are five elements.

sArray = phased.UCA();
N = getNumElements(sArray)
N = 5

Input Arguments

collapse all

Phased array, specified as a phased.NRRectangularPanelArray System object.

Index of subarray, specified as a positive integer.

Data Types: double

Output Arguments

collapse all

Number of array elements, returned as a positive integer.

Number of elements in the mth subarray, returned as a positive integer.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2023b