I know that length(x)
returns max(size(x))
and numel(x)
returns the total number of elements of x, but which is better for a 1 by n array? Does it matter, or are they interchangeable in this case?
EDIT: Just for kicks:
Looks like they're the same performance-wise until you get to 100k elements.
question from:https://stackoverflow.com/questions/3119739/difference-between-matlabs-numel-and-length-functions