Quaternion Function Reference

numel

Number of elements in an array or subscripted array expression
(Quaternion and octonion overloadings of standard MATLAB® function)

Syntax

Y = numel(X)

Description

numel(X) overloads a MATLAB® function with subtle internal uses. It plays a role in subscripted indexing, and although its name suggests that it returns the number of elements in an array, this function DOES NOT return the number of quaternions in the array X. This can be obtained easily by prod(size(q)). The reason for this is complex, but connected with the way MATLAB® implements subscripted indexing. See the notes in the MATLAB® documentation for the numel function. (This function was changed in May 2008. Prior to this date, it did return prod(size(q)) but this was incompatible with correct working of other functions.)

See Also

MATLAB® function: numel
QTFM functions: prod, size

© 2008-2013 Stephen J. Sangwine and Nicolas Le Bihan

License terms.