ismatfile
Checks if filename a valid .mat file
📝Syntax
[tf, ver, header] = ismatfile(filename)
📥Input Arguments
Parameter Description
filename a string: .mat filename.
📤Output Arguments
Parameter Description
tf a logical: true if it is a valid .mat file.
ver a string array: version of .mat file ("-v7.3", "-v7" or "-v6").
header a string array: header of .mat file (date).
📄Description

ismatfile checks if filename a valid .mat file.

💡Examples
A = ones(3, 4);
savemat([tempdir(), 'example_loadmat-v7.3.mat'], 'A', '-v7.3')
savemat([tempdir(), 'example_loadmat-v7.mat'], 'A', '-v7')
savemat([tempdir(), 'example_loadmat-v6.mat'], 'A', '-v6')
[tf, ver] = ismatfile([tempdir(), 'example_loadmat-v7.3.mat']) 
[tf, ver] = ismatfile([tempdir(), 'example_loadmat-v7.mat']) 
[tf, ver] = ismatfile([tempdir(), 'example_loadmat-v6.mat']) 
[tf, ver, header] = ismatfile([tempdir(), 'example_not_existing.mat']) 
🔗See Also
isnh5fileloadmat
📚Bibliography
Thanks to MATIO library (http://sourceforge.net/projects/matio/).
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub