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.1. This page might be outdated.
See the recommended documentation of this function

Scilab manual >> Functions > deff


on-line definition of function

Calling Sequence

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



input variables.


output variables.


matrix of character strings


optional character string


function is "compiled" to be more efficient (default)


function is "compiled" and prepared for profiling (see profile)


function is not "compiled"


deff can be used to define functions from sequences of instructions written in text strings. The resulting function object has the same proprerties of any other function defined in a text file and loaded with exec or 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. An option in such cases is to define functions in files as usual, to load them into Scilab by exec (with the 'n' option) and to use sci2exp to get a printout of corresponding deff instructions.



deff('[x]=mymacro(y,z)',['a=3*y+1'; 'x=a*z+y'])
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jan 26 16:23:48 CET 2011