| MATLAB Function Reference | ![]() |
unzip(zipfilename)
unzip(zipfilename,outputdir)
unzip(url, ...)
filenames = unzip(...)
unzip
unzip(zipfilename) extracts the archived contents of zipfilename into the current directory and sets the files' attributes. It overwrites any existing files with the same names as those in the archive if the existing files' attributes and ownerships permit it. For example, files from rerunning unzip on the same zip filename do not overwrite any of those files that have a read-only attribute; instead, unzip issues a warning for such files.
zipfilename is a string specifying the name of the zip file. The .zip extension is appended to zipfilename if omitted. zipfilename can include the directory name; otherwise, the file must be in the current directory or in a directory on the MATLAB® path.
unzip(zipfilename,outputdir) extracts the contents of zipfilename into the directory outputdir.
unzip(url, ...) extracts the zipped contents from an Internet URL. The URL must include the protocol type (e.g., http://). The URL is downloaded to the temp directory and deleted.
filenames = unzip(...) extracts the zip archive and returns the relative path names of the extracted files into the string cell array filenames.
unzip does not support password-protected or encrypted zip archives.
Copy the demos HTML files to the directory archive:
% Zip the demos html files to demos.zip
zip('demos.zip','*.html',fullfile(matlabroot,'demos'))
% Unzip demos.zip to the 'directory' archive
unzip('demos','archive')
Run unzip to list Cleve Moler's "Numerical Computing with MATLAB" examples to the output directory ncm.
url ='http://www.mathworks.com/moler/ncm.zip';
ncmFiles = unzip(url,'ncm')
fileattrib, gzip, gunzip, tar, untar, zip
![]() | unwrap | upper | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |