Mercurial > octave-nkf
comparison libinterp/corefcn/data.cc @ 20607:db3286201347 stable
doc: Add explanation of ':' optional input to numel().
* data.cc (Fnumel): Add explanation of ':' optional input.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 07 Oct 2015 14:52:01 -0700 |
parents | c6059134f5d3 |
children | 5fc798a9b32c |
comparison
equal
deleted
inserted
replaced
20606:1b62fc4e1b2f | 20607:db3286201347 |
---|---|
2712 \n\ | 2712 \n\ |
2713 @example\n\ | 2713 @example\n\ |
2714 @var{a}(@var{idx1}, @var{idx2}, @dots{})\n\ | 2714 @var{a}(@var{idx1}, @var{idx2}, @dots{})\n\ |
2715 @end example\n\ | 2715 @end example\n\ |
2716 \n\ | 2716 \n\ |
2717 Note that the indices do not have to be numerical. For example,\n\ | 2717 Note that the indices do not have to be scalar numbers. For example,\n\ |
2718 \n\ | 2718 \n\ |
2719 @example\n\ | 2719 @example\n\ |
2720 @group\n\ | 2720 @group\n\ |
2721 @var{a} = 1;\n\ | 2721 @var{a} = 1;\n\ |
2722 @var{b} = ones (2, 3);\n\ | 2722 @var{b} = ones (2, 3);\n\ |
2724 @end group\n\ | 2724 @end group\n\ |
2725 @end example\n\ | 2725 @end example\n\ |
2726 \n\ | 2726 \n\ |
2727 @noindent\n\ | 2727 @noindent\n\ |
2728 will return 6, as this is the number of ways to index with @var{b}.\n\ | 2728 will return 6, as this is the number of ways to index with @var{b}.\n\ |
2729 Or the index could be the string @qcode{\":\"} which represents the colon\n\ | |
2730 operator. For example,\n\ | |
2731 \n\ | |
2732 @example\n\ | |
2733 @group\n\ | |
2734 @var{a} = ones (5, 3);\n\ | |
2735 numel (@var{a}, 2, \":\")\n\ | |
2736 @end group\n\ | |
2737 @end example\n\ | |
2738 \n\ | |
2739 @noindent\n\ | |
2740 will return 3 as the second row has three column entries.\n\ | |
2729 \n\ | 2741 \n\ |
2730 This method is also called when an object appears as lvalue with cs-list\n\ | 2742 This method is also called when an object appears as lvalue with cs-list\n\ |
2731 indexing, i.e., @code{object@{@dots{}@}} or @code{object(@dots{}).field}.\n\ | 2743 indexing, i.e., @code{object@{@dots{}@}} or @code{object(@dots{}).field}.\n\ |
2732 @seealso{size}\n\ | 2744 @seealso{size}\n\ |
2733 @end deftypefn") | 2745 @end deftypefn") |