This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Uncompress GNU zip files


gunzip(url, ...)
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 character vector or cell array of character vectors 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(files,outputdir) writes the gunzipped file into the directory outputdir. If outputdir does not exist, MATLAB creates it.

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.

filenames = gunzip(...) gunzips the files and returns the relative path names of the gunzipped files in filenames.


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 ='';

See Also

| | | |

Introduced before R2006a

Was this topic helpful?