Lists variables of a Matlab binary MAT-file.
[names[, classes[, types]]] = matfile_listvar(fd)
Real: file descriptor (returned by matfile_open).
String vector: names of the variables.
Real vector: classes of the variables.
Real vector: data types of the variables.
Lists variables of a Matlab binary MAT-file opened by matfile_open.
Returns empty matrices if the file contains no variables.
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 | ![]() | ![]() |
This function uses MATIO library (
http://sourceforge.net/projects/matio/
).