matwho

版本 1.0.0.0 (3.1 KB) 作者: Benjamin Kraus
Quickly list the variables in the specified .MAT file.
520.0 次下载
更新时间 2013/6/10

查看许可证

编者注: This file was selected as MATLAB Central Pick of the Week

MATWHO is a MEX file wrapper around the MEX function 'matGetDir' provided in the 'MAT-File Library' by The MathWorks. It lists the variables stored in a .MAT file, similar to using the 'who' function with the location set to '-file', but much faster, particularly on large .MAT files. MATWHO does not support pattern matching on the variable names, it only returns the complete list of variables. It is equivalent to calling: c = who('-file','filename');

This function resulted from a discussion on comp.soft-sys.matlab.
My thanks to Friedrich and James Tursa for their contributions and feedback.

This function must be compiled prior to use. Once you've set up a mex compiler, this is done by calling:
mex matwho.c

I've successfully tested this function on both Linux (Ubuntu), Windows XP (32 bit), and Windows 7 (64 bit), but it should work on any system.

USAGE:
c = matwho('filename')

INPUT:
filename - Name of the '.mat' file to read.

OUTPUT:
c = Cell array of strings that correspond to each variable name.

引用格式

Benjamin Kraus (2024). matwho (https://www.mathworks.com/matlabcentral/fileexchange/42159-matwho), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2011b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Whos 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0