Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.2 - Português

Change language to:
English - Français - 日本語 - Русский

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

Ajuda do Scilab >> Funções > deff

deff

definição on-line de função

Seqüência de Chamamento

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

Parâmetros

e1, e2, ...

variáveis de entrada.

s1, s2, ...

variáveis de saída.

text

matriz de strings.

Descrição

deff pode ser usada para definir funções de seqüências de instruções escritas em strings de textos. Objeto função resultante tem as mesmas propriedades que qualquer outra função definida em um arquivo de texto e carregada através de exec ou exec.

Exemplos

deff('x = myplus(y,z)', 'x = y+z')
myplus(1,%i)

deff('[y, z] = mymacro(x)', ['y = 3*x+1'; 'z = a*x + x.^2'])
a = 3;
[u, v] = mymacro(2)
--> deff('x = myplus(y,z)', 'x = y+z')
--> myplus(1,%i)
 ans  =
   1. + i

--> deff('[y, z] = mymacro(x)', ['y = 3*x+1'; 'z = a*x + x.^2'])
--> a = 3;
--> [u, v] = mymacro(2)
 v  =
   10.

 u  =
   7.

Ver Também

  • function — abre definição de função
  • exec — execução de arquivo script ("script" significa roteiro)
  • getd — retorna todas as funções definidas em um diretório
  • genlib — constrói biblioteca a partir de funções em um diretório
  • jdeff — Map a static Java method onto a Scilab macro
  • jcompile — Compile Java code or file

Histórico

VersãoDescrição
6.0.0
  • The input option opt="c"|"p"|"n" is no longer available.
  • The defined newfunction is now of type 13 (instead of 11).
Report an issue
<< argn Funções exec >>

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:
Thu Feb 14 15:01:10 CET 2019