Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.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ヘルプ >> Matlab binary files I/O > matfile_listvar

matfile_listvar

Matlab バイナリ MATファイルの中の変数の一覧を得る.

呼び出し手順

[names, classes, types] = matfile_listvar(fd)

引数

fd

実数: (matfile_openにより返された)ファイル記述子.

names

文字列ベクトル: 変数名.

types

実数ベクトル: 変数のデータ型.

classes

実数ベクトル: 変数のクラス.

Type name Matlab class Matlab type Scilab type/inttype
cell 12117
struct 22217
text 4 10
sparse 5 5
double real|complex 69 1
single real|complex 77NA
int8 818/1
uint8 928/11
int16 1038/2
uint16 1148/12
int32 1258/4
uint32 1368/14
int64 14128/8
uint64 15138/18

説明

matfile_openにより開かれた MatlabバイナルMATファイルの中の変数の一覧を取得します.

ファイルに変数がない場合, 空の行列が返されます.

// Preparing some data:
H = rand(2,4,2);
N = complex(rand(2,3), rand(2,3));
I = int8(grand(4,10,"uin",-100,100));
T = ["foo" "bar"]';
S = struct("num",H, "imag",N, "text",T, "int",I);
C = {"Scilab", rand(2,3); H, S};

// Saving them:
File = TMPDIR+"/matfile_listvar_example.mat";
savematfile(File,'-v7.3', 'H','N','I','T','S','C');

// Listing stored variables:
fd = matfile_open(File);
[names, classes, types] = matfile_listvar(fd);
matfile_close(fd);

sleep(1000)
deletefile(File);

names', classes', types'
mprintf("The variable ""%s"" has type %d and class %d\n", names, types, classes)
--> names', classes', types'
 ans  =
!C  H  I  N  S  T  !

 ans  =
   1.   6.   8.   6.   2.   4.

 ans  =
   21.   9.   1.   9.   22.   2.

--> mprintf("The variable ""%s"" has type %d and class %d\n", names, types, classes)
The variable "C" has type 21 and class 1
The variable "H" has type 9 and class 6
The variable "I" has type 1 and class 8
The variable "N" has type 9 and class 6
The variable "S" has type 22 and class 2
The variable "T" has type 2 and class 4

参照

  • matfile_open — Matlab バイナリ MAT-ファイルを開く.
  • matfile_close — Matlab バイナリ MATファイルを閉じる.
  • matfile_varwrite — Matlab バイナリ MATファイルに変数を書き込む.
  • matfile_varreadnext — Matlab バイナリ MATファイルの次の変数を読み込む.

参考文献

この関数はMATIOライブラリ ( http://sourceforge.net/projects/matio/ )を使用しています.

Report an issue
<< matfile_close Matlab binary files I/O matfile_open >>

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:
Thu Feb 14 15:02:37 CET 2019