読者です 読者をやめる 読者になる 読者になる

のねのBlog

パソコンやソフト開発で起きた問題など書きます。よろしくお願いします。

octave bsxfun

> help bsxfun
'bsxfun' is a built-in function from the file libinterp/corefcn/bsxfun.cc

 -- bsxfun (F, A, B)
     The binary singleton expansion function performs broadcasting, that
     is, it applies a binary function F element-by-element to two array
     arguments A and B, and expands as necessary singleton dimensions in
     either input argument.

     F is a function handle, inline function, or string containing the
     name of the function to evaluate.  The function F must be capable
     of accepting two column-vector arguments of equal length, or one
     column vector argument and a scalar.

     The dimensions of A and B must be equal or singleton.  The
     singleton dimensions of the arrays will be expanded to the same
     dimensionality as the other array.

     See also: arrayfun, cellfun.

Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help@octave.org
mailing list.

broadcastとsingletonってなんだろ?
singleton dimensions:大きさが1の次元という意味らしい。

: bsxfun (f, A, B)
The binary singleton expansion function performs broadcasting,
 that is, it applies a binary function f 
element-by-element to two array arguments A and B, 
and expands as necessary singleton dimensions in either input argument.

f is a function handle, inline function,
 or string containing the name of the function to evaluate.
 The function f must be capable of accepting 
two column-vector arguments of equal length,
 or one column vector argument and a scalar.

The dimensions of A and B must be equal or singleton. 
The singleton dimensions of the arrays 
will be expanded to the same dimensionality as the other array.

See also: arrayfun, cellfun.

www.gnu.org

stackoverflow.com

jp.mathworks.com