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

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 manual >> Input/Output functions > write

write

フォーマットされたファイルに書き込む

呼び出し手順

write(file-desc,a,[format])
write(file-desc,a,k,format)

パラメータ

file-desc

ファイル名を指定する文字列または論理ユニットを 指定する整数値 (file 参照).

この関数はUTFのファイル名をオープンすることができません. この場合は mopen を使用してください.

a

実数行列または文字列の列ベクトル.

format

文字列, "Fortran" 形式を指定します. この文字列は 右括弧で始まり,左括弧で終わります. 形式には浮動小数点数, 整数または文字編集モードを混ぜることは できません.

k

整数ベクトル

説明

実数行列または文字列の列ベクトルを整形されたファイルに 行毎に書き込みます. 引数aの各行は, file-descファイルの新しい行で始まります. format に基づき a引数の指定した行が file-descファイルの複数行に書き込まれます.

Formatの例 : (1x,e10.3,5x,3(f3.0)) , (10x,a20) ;

詳細はFortranブックを参照ください.

直接アクセスファイル : x=write(file_desc,a,k,format). ここで k はレコードのベクトルです (行毎に1レコード, すなわち, m=prod(size(k))

write(%io(2),....) は Scilabのウインドウを書き込みます. この場合,formatは 行列の各行について1行出力する必要があります. この拘束条件が確認できない場合,予測できない結果となる可能性があります.

if getos() == 'Windows' then unix('del asave');
else unix('rm -f asave'); end
A=rand(5,3); write('asave',A); A=read('asave',5,3);
write(%io(2),A,'('' | '',3(f10.3,'' | ''))')
write(%io(2),string(1:10))
write(%io(2),strcat(string(1:10),','))
write(%io(2),1:10,'(10(i2,3x))')

if getos() == 'Windows' then unix('del foo');
else unix('rm -f foo'); end
write('foo',A)
<< writb Input/Output functions write4b >>

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:
Wed Jan 26 16:25:11 CET 2011