next up previous contents index
Next: MXデータフォーマット Up: データフォーマット Previous: データフォーマット

   
MATデータフォーマット

1.
ファイルの第1行目は#で始まり,行数(整数),列数(整数)が続き, 複素行列のデータの場合には次に大文字のCが続く。
2.
データはスペース,タブ,改行のいずれかで区切られる。
3.
#で始まる行はコメントと見なされる。
4.
行末にある必要以上のデータは無視される。
実行列

¥begin{displaymath}¥left[¥begin{array}{rrrr}
1 & 2 & 3 & 4¥¥
5 & 6 & 7 & 8¥¥
9 & 10 & 11 & 12
¥end{array}¥right]
¥end{displaymath}

をファイルに保存すると

# 3 4
  1.0000   5.0000   9.0000
  2.0000   6.0000   10.000
  3.0000   7.0000   11.000
  4.0000   8.0000   12.000


となり,複素行列

¥begin{displaymath}¥left[¥begin{array}{rrr}
1 + 2i & 3 + 4i & 5 + 6i¥¥
7 + 8i & 9 + 10i & 11 + 12i
¥end{array}¥right]
¥end{displaymath}

をファイルに保存すると,

# 2 3 C
  1.0000   2.0000   7.0000   8.0000
  3.0000   4.0000   9.0000   10.000
  5.0000   6.0000   11.000   12.000


となる。フォーマット規則の3と4より,次のようなファイルを読み込むことも できる。


# 2 2
#
# This file contains data of simulation (1)
#
1.00 2.00  # This is the end of first column
# This line is commented out.
3.00 4.00  # This is the end of second column
#
# End of file
#




Masanobu KOGA 平成10年8月19日