Extract contents of zip file
unzip(zipfilename)
unzip(zipfilename,outputdir)
filenames = unzip(zipfilename,outputdir)
unzip(
extracts
the archived contents of zipfilename
)zipfilename
into the current
folder, preserving the files' attributes and timestamps. The unzip
function
can extract files from your local system or files from an Internet
URL.
unzip(
extracts
the contents of zipfilename
,outputdir
)zipfilename
into the folder outputdir
.
returns
the names of the extracted files in the cell array of character vectors, filenames
= unzip(zipfilename
,outputdir
)filenames
.
Specifying outputdir
is optional.
|
Name of the zip file, specified as a character vector. If 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. If |
Copy the example MAT-files to the folder archive
:
% 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 ncm
:
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.