Documentation Center

  • Trial Software
  • Product Updates


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 string or cell array of strings 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.


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 the string cell array filenames.


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


See Also

| | | |

Was this topic helpful?