开发者

How do I view a .mat file in either MATLAB or the Unix shell?

I just want to view the contents of the file. It's in a directory, which I have access to. Is there a Unix command to view the contents of it? I can also load it 开发者_运维问答in MATLAB. Is there a similar MATLAB command?

Thanks


To load myFile.mat from your home directory, start Matlab and call

load ~/myFile.mat

This loads the file into your workspace, and lets you inspect its contents.

If you have a more recent version of Matlab, you can also click on it in Matlab's directory browser, beneath which you see a preview of the contents (e.g. the variables it contains). Also, double-clicking on the file in Matlab's directory browser opens an import dialog.

Since more recent versions of Matlab save files in hdf5 format, you can open the file from the Unix commmand line with any tool that is capable of reading that format. However, opening it in Matlab is usually the more convenient option.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜