File: arrayfun.mdc

package info (click to toggle)
freemat 4.2%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 141,800 kB
  • ctags: 14,082
  • sloc: ansic: 126,788; cpp: 62,046; python: 2,080; perl: 1,255; sh: 1,146; yacc: 1,019; lex: 239; makefile: 100
file content (50 lines) | stat: -rw-r--r-- 1,686 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

 Usage

The arrayfun function is used to apply a function handle to
each element of an input array (or arrays), and to collect
the outputs into an array. The general syntax for its use is

     y = arrayfun(fun, x)

where x is an N-dimensional array. In this case, each
element of the output y_i is defined as fun(x_i). You can
also supply multiple arguments to arrayfun, provided all of
the arguments are the same size

     y = arrayfun(fun, x, z,...)

in which case each output y_i = fun(x_i,z_i,...).
If the function returns multiple outputs, then arrayfun can
be called with multiple outputs, in which case each output
goes to a separate array output

     [y1,y2,...] = arrayfun(fun, x, z, ...)

The assumption is that the output types for each call to fun
is the same across the inputs.
Finally, some hints can be provided to arrayfun using the
syntax

     [y1,y2,...] = arrayfun(fun, x, z, ..., 'param', value,
  'param', value)

where param and value take on the following possible values:

* 'UniformOutput' - if the value is true then each output of
  fun must be a scalar, and the outputs are concatenated
  into an array the same size as the input arrays. If the
  value is false then the outputs are encapsulated into a
  cell array, with each entry in the cell array containing
  the call to fun(x_i,z_i,...).
* 'ErrorHandler' - in this case value is a function handle
  that gets called when fun throws an error. If
  'ErrorHandler' is not specified, then arrayfun allows the
  error to propogate (i.e., and exception is thrown).


* FreeMat_Documentation
* Array_Generation_and_Manipulations
* Generated on Thu Jul 25 2013 17:17:13 for FreeMat by
  doxygen_ 1.8.1.1