evstr
式を評価する
呼び出し手順
H = evstr(Z) [H, ierr] = evstr(Z)
引数
- Z
文字列の行列
Mまたはlist(M,Subexp)- M
文字列の行列
- Subexp
文字列のベクトル
- H
行列
- ierr
整数, エラーインジケータ
説明
文字列の行列Mを評価した結果を返します.
行列の各要素は有効なScilab式を定義している必要があります.
M式の評価でエラーが発生した場合,
戻り値が1つの版,H = evstr(M),では通常と同様に
エラーを発生します.
一方,戻り値が2つの版,[H,ierr] = evstr(M),
はエラーを発生しませんが,ierrにエラー番号が
返されます.
Z がリストの場合, Subexp は
文字列のベクトルとなり,Mを評価する前に
評価されるsub_expressionsを定義します.
これらのsub_expressionsは,Mの中では
%(k)として参照する必要があります.
ただし,kはSubexpにおける
sub-expressionのインデックスです.
evstr('a = 1') は有効ではありません
(代わりにexecstrを使用してください).
Nan, NaN
は %nan と評価されます.
Inf は %inf と評価されます.
![]() | Z は,継続記号 (..)で分解できない
ことに注意してください. |
例
a = 1; b = 2; Z = ['a', 'b'] ; evstr(Z) Z = list(['%(1)','%(1)-%(2)'],['a+1','b+1']); evstr(Z) evstr('NaN'), evstr('Inf') //The two return values version [H, ierr] = evstr(Z) // no error Z = ['a', 'b', 'c'] ;// the variable c is undefined [H, ierr] = evstr(Z) // error 4: Undefined variable: c
参照
- execstr — 文字列中のScilabコードを実行
- sci2exp — returns a string able to generate a given Scilab object
- strtod — parse and convert literal numbers STRings TO Decimal numbers
- concatenation — Concatenation. Recipients of an assignment. Results of a function
履歴
| バージョン | 記述 |
| 5.3.0 | "Nan" and "NaN" are now parsed as %nan.
"Inf" and "INF" are now parsed as %inf. |
| 6.0.1 | Simple comments are now supported in almost all possible input expressions,
whatever is the shape of M. |
| Report an issue | ||
| << emptystr | Strings | grep >> |
