1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * This file is hereby licensed under the terms of the GNU GPL v2.0,
8 * pursuant to article 5.3.4 of the CeCILL v.2.1.
9 * This file was originally licensed under the terms of the CeCILL v2.1,
10 * and continues to be available under such terms.
11 * For more information, see the COPYING file which you should have received
12 * along with this program.
15 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
16 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
17 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
18 xmlns:scilab="http://www.scilab.org" xml:id="evstr" xml:lang="ja">
20 <refname>evstr</refname>
21 <refpurpose>式を評価する</refpurpose>
37 文字列の行列 <varname>M</varname> または
38 <code>list(M,Subexp)</code>
65 <para>整数, エラーインジケータ</para>
73 文字列の行列<varname>M</varname>を評価した結果を返します.
74 行列の各要素は有効なScilab式を定義している必要があります.
77 <varname>M</varname>式の評価でエラーが発生した場合,
78 戻り値が1つの版,<code>H = evstr(M)</code>,では通常と同様に
80 一方,戻り値が2つの版,<code>[H,ierr] = evstr(M)</code>,
81 はエラーを発生しませんが,<varname>ierr</varname>にエラー番号が
85 <varname>Z</varname> がリストの場合, <varname>Subexp</varname> は
86 文字列のベクトルとなり,<varname>M</varname>を評価する前に
87 評価されるsub_expressionsを定義します.
88 これらのsub_expressionsは,<varname>M</varname>の中では
89 <literal>%(k)</literal>として参照する必要があります.
90 ただし,<literal>k</literal>は<varname>Subexp</varname>における
91 sub-expressionのインデックスです.
94 <code>evstr('a = 1')</code> は有効ではありません
95 (代わりに<function>execstr</function>を使用してください).
98 <literal>Nan</literal>, <literal>NaN</literal>
99 は <constant>%nan</constant> と評価されます.
102 <literal>Inf</literal> は <constant>%inf</constant> と評価されます.
105 <varname>Z</varname> は,継続記号 (..)で分解できない
111 <programlisting role="example"><![CDATA[
116 Z = list(['%(1)','%(1)-%(2)'],['a+1','b+1']);
118 evstr('NaN'), evstr('Inf')
120 //The two return values version
121 [H, ierr] = evstr(Z) // no error
122 Z = ['a', 'b', 'c'] ;// the variable c is undefined
123 [H, ierr] = evstr(Z) // error 4: Undefined variable: c
127 <refsection role="see also">
129 <simplelist type="inline">
131 <link linkend="execstr">execstr</link>
134 <link linkend="sci2exp">sci2exp</link>
137 <link linkend="strtod">strtod</link>
140 <link linkend="brackets">concatenation</link>
144 <refsection role="history">
148 <revnumber>5.3.0</revnumber>
150 <literal>"Nan"</literal> and <literal>"NaN"</literal> are now parsed as <literal>%nan</literal>.
151 <literal>"Inf"</literal> and <literal>"INF"</literal> are now parsed as <literal>%inf</literal>.
155 <revnumber>6.0.1</revnumber>
157 Simple comments are now supported in almost all possible input expressions,
158 whatever is the shape of <literal>M</literal>.