Please note that the recommended version of Scilab is 2026.0.0. This page might be outdated.
See the recommended documentation of this function
mfprintf
変換,整形し,ファイルにデータを書き込む
呼び出し手順
mfprintf(fd, format, a1, ..., an);
引数
- fd
- スカラー, - mopenで指定したファイル記述子 (正の整数).- fdが 0 の場合, stderr へのリダイレクション.- fdが 6 の場合, stdout へのリダイレクション.- 古い仕様 :値 - -1はデフォルトのファイル ( すなわち直近にオープンされたファイル)を指します.
- format
- 残りのオペランドを書き込む際に使用されるフォーマットを指定する Scilab 文字列. - formatオペランドはCの- printfのフォーマットオペランドの構文に可能な限り似せられています.
- str
- 文字列: スキャンされる文字列. 
- a1, ..., an
- formatパラメータに基づき変換,出力されるデータ. 
説明
mfprintf 関数は, C言語のfprintf関数への
            インターフェイスです.
mfprintf関数は,整形されたオペランドを
            ファイル記述子fdで指定したファイルに書き込みます.
            引数のオペランドは,formatオペランドの制御のもとで整形されます.
この関数は数値の列ベクトルおよび文字列ベクトルを要素に関する 明示的なループ処理を行うことなく出力する際に使用することができます. この場合,この関数は行に関する反復処理を行ないます. 最も短いベクトルはフォーマットの反復回数を指定します.
同じ型パラメータの一様なシーケンスは 行列で置換することができます.
例
fd = mopen(TMPDIR+'/text.txt','wt'); mfprintf(fd,'hello %s %d.\n','world',1); mfprintf(fd,'hello %s %d.\n','scilab',2); mfprintf(fd,'This line is built with a column vector (26:28) %d.\n',[26:28].'); mfprintf(fd,'This line is built with a row vector (26:28) %d.\n',[26:28]); A = rand(3,6); mfprintf(fd,'This line is built with a matrix %.3f.\n',A); mclose(fd); if (isdef('editor') | (funptr('editor')<>0)) then editor(TMPDIR+'/text.txt') end mfprintf(0,'stderr output.\n'); mfprintf(6,'stdout output.\n');
参照
| Report an issue | ||
| << merror | Files : Input/Output functions | mscanf >> |