Uncompress GNU zip files
filenames = gunzip(...)
gunzip(files) uncompresses GNU zip files from the list of files specified in files. Directories recursively gunzip all of their content. The output files have the same name, excluding the extension .gz, and are written to the same directory as the input files.
files is a string or cell array of strings containing a list of files or directories. Individual files that are on the MATLAB® path can be specified as partial path names. Otherwise, an individual file can be specified relative to the current directory or with an absolute path.
Folders must be specified relative to the current folder or with absolute paths. On UNIX® systems, folders can also start with ~/ or ~username/, which expands to the current user's home folder or the specified user's home folder, respectively. The wildcard character * can be used when specifying files or folders, except when relying on the MATLAB path to resolve a file name or partial path name.
gunzip(url, ...) extracts the GNU zip contents from an Internet universal resource locator (URL). The URL must include the protocol type (for example, 'http://'). MATLAB downloads the URL to the temp directory, and then deletes it.
To gunzip all .gz files in the current directory, type:
To gunzip Cleve Moler's "Numerical Computing with MATLAB" examples to the output directory ncm, type:
url ='http://www.mathworks.com/moler/ncm.tar.gz'; gunzip(url,'ncm') untar('ncm/ncm.tar','ncm')