Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский

Please note that the recommended version of Scilab is 6.1.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Advanced functions > deff


on-line definition of function


deff('[s1, s2, ...] = newfunction(e1, e2, ...)',text)


e1, e2, ...

input variables.

s1, s2, ...

output variables.


a matrix of character strings.


deff can be used to define functions from sequences of instructions written in text strings. The resulting function object has the same properties of any other function defined in a text file and loaded with exec.

Quotes in the instructions (delimiting strings or meaning matrix transposition) have to be doubled to be interpreted correctly (see help quote). This can make writing up a little awkward.


deff('[x]=mymacro(y,z)',['a=3*y+1'; 'x=a*z+y'])

See also

  • exec — script file execution
  • function — opens a function definition
  • quote — (') transpose operator, string delimiter
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:03:08 CET 2017