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.


Compress files into GNU zip files


filenames = gzip(...)


gzip(files) creates GNU zip files from the list of files specified in files. Directories recursively gzip all their contents. Each output gzipped file is written to the same directory as the input file and with the file extension .gz.

files is a character vector or cell array of character vectors containing a list of files or directories to gzip. 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.

gzip(files,outputdir) writes the gzipped files into the directory outputdir. If outputdir does not exist, MATLAB creates it.

filenames = gzip(...) gzips the files and returns the relative path names of all gzipped files in filenames.


To gzip all .m and .mat files in the current directory and store the results in the directory archive, type:


See Also

| | | |

Introduced before R2006a

Was this topic helpful?