Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.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ヘルプ >> Files : Input/Output functions > fprintfMat

fprintfMat

行列をファイルに書き込む

呼び出し手順

fprintfMat(file, M [,format,text])

引数

fil

文字列, 書き込むファイルのパス名

M

実数の行列

format

形式を指定する文字列. オプションのパラメータで, デフォルト値は"%lf".

サポートされる形式: %[width].[precision]type または %type, ただし:

width: 文字出力の最小数を指定するオプションの数値;

precision: 出力フィールド全てまたは一部に関する 出力される文字の最大数を指定するオプションの数値; または整数値を印字する桁の最小数;

type: lf, lg, d, i, e, f, g (詳細はscanf_conversion を参照).

text

ファイルの先頭に保存される 数値以外のコメントを指定する文字列の行(列)ベクトル.

説明

fprintfMat 関数は,整形済みのファイルに 行列を書き込みます. 行列の各行はファイルの中で1行となります. textが指定された場合, ファイルの先頭に1行に1要素/行で textの要素が要素毎に挿入されます.

n = 50;
a = rand(n, n, "u");
fprintfMat(TMPDIR + "/Mat", a, "%5.2f");
a1 = fscanfMat(TMPDIR + "/Mat");

// ファイルMat1を作成し, コメントを挿入します
some_comment = ["This is a comment","This the second line of the comment.","This is the third line of the comment."];
fprintfMat(TMPDIR + "/Mat1", a, "%5.2f",some_comment);

参照

  • scanf_conversion — mscanf, msscanf, mfscanf 変換指定子
  • mclose — オープンされているファイルを閉じる
  • meof — ファイルの終端に達したかどうかを確認する
  • mfprintf — 変換,整形し,ファイルにデータを書き込む
  • mfscanf — 標準入力から入力を読み込む (C言語の scanf 関数へのインターフェイス)
  • fscanfMat — テキストファイルから行列を読み込む
  • mget — 指定したバイナリ形式で バイトまたはワードを読み込み, double に変換
  • mgetstr — ファイルから文字列を読み込む
  • mopen — ファイルをオープン
  • mprintf — 変換, 整形し, Scilab主ウインドウにデータを書き込む
  • mput — 指定したバイナリ形式でバイトまたはワードを書き込む
  • mputstr — ファイルに文字列を書き込む
  • mscanf
  • mseek — バイナリファイルの中でカレントの位置を設定する.
  • mtell — ファイル先頭基準でカレントバイトのオフセットを返す
  • mdelete — ファイルを削除
Report an issue
<< findfiles Files : Input/Output functions fscanfMat >>

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 Apr 01 10:25:03 CEST 2015