Extract contents of zip file
filenames = unzip(zipfilename,outputdir)
the archived contents of
zipfilename into the current
folder, preserving the files' attributes and timestamps. The
can extract files from your local system or files from an Internet
Name of the zip file, specified as a character vector.
If you are downloading a URL,
Target folder for the extracted files, specified as a character vector.
Default: current folder (
Cell array of character vectors that contains the paths of the extracted files.
Copy the example MAT-files to the folder
% Zip the example MAT-files to examples.zip zip('examples.zip','*.mat',... fullfile(matlabroot,'toolbox','matlab','demos')) % Unzip examples.zip to the folder 'archive' unzip('examples','archive')
Download Cleve Moler's "Numerical Computing with MATLAB" examples
to the output folder
url ='http://www.mathworks.com/moler/ncm.zip'; ncmFiles = unzip(url,'ncm')
To extract files from a zip file using the Current Folder browser, select the zip file, right-click to open the context menu, and then select Extract.
unzip does not support password-protected
or encrypted zip archives.
If any files in the target folder have the same name
as files in the zip file, and you have write permission to the files,
the existing files with the archived versions. If you do not have
unzip issues a warning.
Extract files that contain non-7-bit ASCII characters on a machine that has the appropriate language/encoding settings.