Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.2 - 日本語

Change language to:
English - Français - Português - Русский

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

Scilabヘルプ >> Functions > deff

deff

関数のオンライン定義

呼び出し手順

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

引数

e1, e2, ...

入力変数.

s1, s2, ...

出力変数.

text

文字列行列

説明

deff はテキスト文字列で記述された一連の命令から 関数を定義する際に使用されます. 得られる関数オブジェクトはテキストファイルで定義され, exec または exec で 定義された他の関数と同じ特性を有しています.

> 命令の中の引用符(文字列の区切りまたは行列の転置を意味する)は, ただしく解釈されるように二重化する必要があります(quoteのヘルプを参照). この仕様のため,作成作業はやや不便となります.

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.

参照

  • function — 関数定義をオープンする
  • exec — スクリプトファイルを実行する
  • getd — ディレクトリで定義された全ての関数を取得する
  • genlib — 指定したディレクトリの関数からライブラリを構築する
  • jdeff — 静的JavaメソッドをScilabマクロにマップ
  • jcompile — Javaコードまたはファイルをコンパイルする

履歴

バージョン記述
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 Functions 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:02:37 CET 2019