| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
unzip(zipfilename)
unzip(zipfilename, outputdir)
unzip(url,
...)
filenames =
unzip(...)
unzip(zipfilename) extracts the archived contents of zipfilename into the current folder and sets the files' attributes, preserving the timestamps. 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 folder name; otherwise, the file must be in the current folder or in a folder on the MATLAB path.
unzip(zipfilename, outputdir) extracts the contents of zipfilename into the folder outputdir.
unzip(url, ...) extracts the zipped contents from an Internet URL. The URL must include the protocol type (for example, http://). The URL is downloaded to the temp folder and deleted.
filenames = unzip(...) extracts the zip archive and returns the names of the extracted files in the string cell array filenames. If outputdir specifies a relative path, filenames contains the relative path. If outputdir specifies an absolute path, filenames contains the absolute path.
unzip does not support password-protected or encrypted zip archives.
Copy the demos HTML files to the folder archive:
% Zip the demo MAT-files to demos.zip
zip('demos.zip','*.mat',...
fullfile(matlabroot,'toolbox','matlab','demos'))
% Unzip demos.zip to the folder 'archive'
unzip('demos','archive')
Run unzip to list 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')
fileattrib, gzip, gunzip, tar, untar, zip
![]() | unwrap | upper | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |