Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.2 - Français

Change language to:
English - 日本語 - Português - Русский

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

Aide de Scilab >> Fonctions avancées > deff


on-line definition of function

Calling Sequence

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


e1, e2, ...

input variables.

s1, s2, ...

output variables.


a matrix of character strings.


an optional character string:


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


function is "compiled" and prepared for profiling (see help 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 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. 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'])

See Also

  • comp — pré-interprétation ou "compilation" de fonctions Scilab
  • exec — exécution d'un script (fichier de commandes)
  • function — définition d'une fonction Scilab
  • profile — Renvoie les résultats du profiling d'une fonction
  • quote — opérateur de transposition, délimiteur de chaîne de caractères
Report an issue
<< code2str Fonctions avancées edit >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Apr 01 10:21:53 CEST 2015