Navigation

Operators and Keywords

Function List:

C++ API

: vectorize (fun)

Create a vectorized version of the inline function fun by replacing all occurrences of *, /, etc., with .*, ./, etc.

This may be useful, for example, when using inline functions with numerical integration or optimization where a vector-valued function is expected.

fcn = vectorize (inline ("x^2 - 1"))
  ⇒ fcn = f(x) = x.^2 - 1
quadv (fcn, 0, 3)
  ⇒ 6

See also: inline, formula, argnames.

Package: octave