# HG changeset patch # User Rik # Date 1444254721 25200 # Node ID db32862013471fe41719af13d63c158534f820e5 # Parent 1b62fc4e1b2f7a51982cd4582b49be4644726b44 doc: Add explanation of ':' optional input to numel(). * data.cc (Fnumel): Add explanation of ':' optional input. diff -r 1b62fc4e1b2f -r db3286201347 libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Wed Oct 07 14:41:39 2015 -0700 +++ b/libinterp/corefcn/data.cc Wed Oct 07 14:52:01 2015 -0700 @@ -2714,7 +2714,7 @@ @var{a}(@var{idx1}, @var{idx2}, @dots{})\n\ @end example\n\ \n\ -Note that the indices do not have to be numerical. For example,\n\ +Note that the indices do not have to be scalar numbers. For example,\n\ \n\ @example\n\ @group\n\ @@ -2726,6 +2726,18 @@ \n\ @noindent\n\ will return 6, as this is the number of ways to index with @var{b}.\n\ +Or the index could be the string @qcode{\":\"} which represents the colon\n\ +operator. For example,\n\ +\n\ +@example\n\ +@group\n\ +@var{a} = ones (5, 3);\n\ +numel (@var{a}, 2, \":\")\n\ +@end group\n\ +@end example\n\ +\n\ +@noindent\n\ +will return 3 as the second row has three column entries.\n\ \n\ This method is also called when an object appears as lvalue with cs-list\n\ indexing, i.e., @code{object@{@dots{}@}} or @code{object(@dots{}).field}.\n\