在MATLAB中解压缩.Z文件

时间:2016-08-17 15:38:41

标签: matlab compression

无论如何,我可以在MATLAB中提取.Z文件的内容吗?我已经尝试过MATLAB函数unzipgunzipuntar,但没有任何对我有用。

1 个答案:

答案 0 :(得分:0)

编写调用Linux / Windows命令的Matlab函数(在本例中为uncompress name.z)有什么问题?在Linux上,类似这样:

function uncompress(filename)

   str = ['uncompress', '  ', filename]; % note the blank

   system(str);

在Windows上,您可以使用7zip:

function uncompress(filename)

   path_to_7z='C:\Program Files\7-Zip\7z.exe'; % adapt to your path

   str = [path_to_7z, ' ', filename]; % note the blank

   system(str);

现在您可以使用Matlab的全新解压缩功能:

>>uncompress('file_to_uncompress.z')