Mercurial > octave-nkf
comparison src/DLD-FUNCTIONS/cellfun.cc @ 12932:f951ffdd0133
doc: Document numel option to cellfun. Use fewer function handles in examples.
* cellfun.cc: Document numel option to cellfun. Use fewer function handles
in examples.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 06 Aug 2011 18:31:28 -0700 |
parents | f96b9b9f141b |
children | 982d59e27565 |
comparison
equal
deleted
inserted
replaced
12931:cefd568ea073 | 12932:f951ffdd0133 |
---|---|
120 Return a vector of the lengths of cell elements.\n\ | 120 Return a vector of the lengths of cell elements.\n\ |
121 \n\ | 121 \n\ |
122 @item ndims\n\ | 122 @item ndims\n\ |
123 Return the number of dimensions of each element.\n\ | 123 Return the number of dimensions of each element.\n\ |
124 \n\ | 124 \n\ |
125 @item prodofsize\n\ | 125 @item numel\n\ |
126 Return the product of dimensions of each element.\n\ | 126 @itemx prodofsize\n\ |
127 Return the number of elements contained within each cell element. The\n\ | |
128 number is the product of the dimensions of the object at each cell element.\n\ | |
127 \n\ | 129 \n\ |
128 @item size\n\ | 130 @item size\n\ |
129 Return the size along the @var{k}-th dimension.\n\ | 131 Return the size along the @var{k}-th dimension.\n\ |
130 \n\ | 132 \n\ |
131 @item isclass\n\ | 133 @item isclass\n\ |
140 with the inputs arguments given by @var{C}, @var{D}, etc. Equally the\n\ | 142 with the inputs arguments given by @var{C}, @var{D}, etc. Equally the\n\ |
141 function can return one or more output arguments. For example:\n\ | 143 function can return one or more output arguments. For example:\n\ |
142 \n\ | 144 \n\ |
143 @example\n\ | 145 @example\n\ |
144 @group\n\ | 146 @group\n\ |
145 cellfun (@@atan2, @{1, 0@}, @{0, 1@})\n\ | 147 cellfun (\"atan2\", @{1, 0@}, @{0, 1@})\n\ |
146 @result{}ans = [1.57080 0.00000]\n\ | 148 @result{}ans = [1.57080 0.00000]\n\ |
147 @end group\n\ | 149 @end group\n\ |
148 @end example\n\ | 150 @end example\n\ |
149 \n\ | 151 \n\ |
150 The number of output arguments of @code{cellfun} matches the number of output\n\ | 152 The number of output arguments of @code{cellfun} matches the number of output\n\ |
175 array(s). If 'UniformOutput' is false, the outputs are concatenated into a\n\ | 177 array(s). If 'UniformOutput' is false, the outputs are concatenated into a\n\ |
176 cell array (or cell arrays). For example:\n\ | 178 cell array (or cell arrays). For example:\n\ |
177 \n\ | 179 \n\ |
178 @example\n\ | 180 @example\n\ |
179 @group\n\ | 181 @group\n\ |
180 cellfun (\"tolower(x)\", @{\"Foo\", \"Bar\", \"FooBar\"@},\n\ | 182 cellfun (\"tolower\", @{\"Foo\", \"Bar\", \"FooBar\"@},\n\ |
181 \"UniformOutput\",false)\n\ | 183 \"UniformOutput\",false)\n\ |
182 @result{} ans = @{\"foo\", \"bar\", \"foobar\"@}\n\ | 184 @result{} ans = @{\"foo\", \"bar\", \"foobar\"@}\n\ |
183 @end group\n\ | 185 @end group\n\ |
184 @end example\n\ | 186 @end example\n\ |
185 \n\ | 187 \n\ |
198 of the element that caused the error. For example:\n\ | 200 of the element that caused the error. For example:\n\ |
199 \n\ | 201 \n\ |
200 @example\n\ | 202 @example\n\ |
201 @group\n\ | 203 @group\n\ |
202 function y = foo (s, x), y = NaN; endfunction\n\ | 204 function y = foo (s, x), y = NaN; endfunction\n\ |
203 cellfun (@@factorial, @{-1,2@},'ErrorHandler',@@foo)\n\ | 205 cellfun (\"factorial\", @{-1,2@}, 'ErrorHandler', @@foo)\n\ |
204 @result{} ans = [NaN 2]\n\ | 206 @result{} ans = [NaN 2]\n\ |
205 @end group\n\ | 207 @end group\n\ |
206 @end example\n\ | 208 @end example\n\ |
207 \n\ | 209 \n\ |
208 @seealso{arrayfun, structfun, spfun}\n\ | 210 @seealso{arrayfun, structfun, spfun}\n\ |