| Contents | Index |
zip(zipfile,files)
zip(zipfile,files,rootfolder)
entrynames = zip(zipfile,files,rootfolder)
zip(zipfile,files) creates a zip file with the name zipfile from the list of files and folders specified in files. Folders recursively include all of their content.
zip(zipfile,files,rootfolder) specifies the path for files relative to rootfolder instead of the current folder.
entrynames = zip(zipfile,files,rootfolder) returns a string cell array of the names of the files contained in zipfile. Specifying rootfolder is optional.
entrynames |
Cell array of strings that contain the paths to the files in zipfile. If files includes relative paths, entrynames also contains relative paths. |
Create a zip file of the file membrane.m, which is in the MATLAB general folder. Save the zip file tmwlogo.zip in the current folder:
file = fullfile(matlabroot,'toolbox','matlab','general','membrane.m');
zip('tmwlogo',file);Suppose that your system has a folder named d:/myfiles. Zip the files membrane.m and logo.m, which are on the MATLAB search path, into a file named tmwlogo.zip:
myfile = fullfile('d:','myfiles','tmwlogo.zip');
zip(myfile,{'membrane.m','logo.m'});
Zip all .m and .mat files in the current folder to the file backup.zip:
zip('backup',{'*.m','*.mat'});
Suppose that your current folder contains a subfolder named mywork. Zip the contents of all subfolders of mywork, and store the relative paths in the zip file:
zip('myfiles.zip','mywork');
Suppose that you have files thesis.doc and defense.ppt in d:/PhD. Zip these files into thesis.zip, one level up from the current folder:
zip('../thesis.zip',{'thesis.doc','defense.ppt'},'d:/PhD');
To zip files in the Current Folder browser, select the files, right-click to open the context menu, and then select Create Zip File.
gunzip | gzip | tar | untar | unzip
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |