zip
Compress files into ZIP file
Syntax
Description
zip(
compresses the contents of zipfilename,filenames)filenames into the ZIP file
zipfilename. zip recursively
compresses the content in folders. If you specify filenames using relative paths,
the resulting ZIP file is structured with the paths of filenames relative to the
current folder. If you specify absolute paths, the files are stored in the root
folder of the ZIP archive.
zip(
specifies the paths for zipfilename,filenames,rootfolder)filenames relative to
rootfolder rather than the current folder.
zip(___,Password=
creates a password-protected, encrypted, ZIP file using the specified password and
encryption method. password,EncryptionMethod=encryptionmethod)zip does not encrypt an empty file. You can
specify these arguments in addition to any of the input argument combinations in the
previous syntaxes. (since R2024b)
returns a cell array of character vectors containing the names of the files included
in entrynames = zip(___)zipfilename.
Examples
Input Arguments
Output Arguments
Limitations
On Linux systems, AES-128 and AES-256 encryption methods are not supported.
Alternative Functionality
To ZIP files in the Files panel, select the file, right-click to open the context menu, and then select Create Zip File.