Matlab バイナリ MATファイルの中の変数の一覧を得る.
[names[, classes[, types]]] = matfile_listvar(fd)
実数: (matfile_openにより返された)ファイル記述子.
文字列ベクトル: 変数名.
実数ベクトル: 変数のクラス.
実数ベクトル: 変数のデータ型.
A = rand(10,10); B = sprand(100,100,0.1); C = "foo"; D = "bar"; savematfile('test_matfile.mat','A','B','C','D','-v6'); clear(); fd = matfile_open("test_matfile.mat"); [name, classes, types]=matfile_listvar(fd); matfile_close(fd); for i=1:size(name,"*") do disp("The variable " + name(i) + " has type " + string(types(i)) + " and class " + string(classes(i))) end | ![]() | ![]() |
この関数はMATIOライブラリ (
http://sourceforge.net/projects/matio/
)を使用しています.