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 >> Files : Input/Output functions > fscanfMat

fscanfMat

テキストファイルから行列を読み込む.

呼び出し手順

M=fscanfMat(filename);
[M,text]=fscanfMat(filename);

パラメータ

filename

スキャンするファイルの名前を指定する文字列.

M

出力変数. 実数の行列.

text

出力変数. 文字列行列.

説明

fscanfMat 関数はテキストファイルからスカラー行列を読み込むために 使用されます. textが指定された場合,ファイルの先頭の非数値の行が 返されます.残りの行の列の数は同じである必要があります (コロンセパレータは空白文字またはタブ文字であるとみなされます). 行列の列の数はファイルでみつかった列の数となり, 行の数は入力ファイルの終端を検出するまでに取得した行数と なります. この関数はfprintfMatで保存した数値データを 読み戻すために使用することができます.

fd=mopen(TMPDIR+'/Mat','w');
mfprintf(fd,'Some text.....\n');
mfprintf(fd,'Some text again\n');
a=rand(6,6);
for i=1:6 ,
  for j=1:6, mfprintf(fd,'%5.2f ',a(i,j));end;
  mfprintf(fd,'\n'); 
end
mclose(fd);
a1=fscanfMat(TMPDIR+'/Mat')
<< fscanf Files : Input/Output functions fullfile >>

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