- •Is the same as the previous syntax, but accepts attribute value pairs,
- •Xlsfinfo Determine if file contains Microsoft Excel spreadsheet.
- •Internet resource
- •Is a string. Message is either a string or a cell array. If it is a
- •Variables and the Windows registry.
- •Zip file access
- •Individual file can be specified relative to the current directory or
- •Tar file access
- •Individual file can be specified relative to the current directory or
- •Gzip file access
- •Individual file can be specified relative to the current directory or
- •Formatted file I/o
- •Icinterface/fgets
- •If %s is used an element read may cause several matlab matrix
- •Integer NaN as zero.
- •If true, textscan treats
- •File opening and closing
- •It on the matlab search path. On unix systems, filename may also start
- •Binary file I/o
- •If the most recent I/o operation was successful, message is empty
- •Indicator in the specified file. Position is indicated in bytes
- •Memory-mapped file support
- •Is correct for platform it's executed on.
- •Is also a valid partial pathname.
- •Serial port support
- •Instrfind will not find an object with a Name property value of
- •Instrfind will not find an object with a Name property value of
- •Timer support
- •Visible timer objects whose property names and property values match
- •Command window I/o
- •In the current directory. The folder contains an m-file for each web service
Is a string. Message is either a string or a cell array. If it is a
string, the text will automatically wrap at 75 characters. If it is a cell
array, it won't wrap, but each cell starts a new line. In either case, use
char(10) to explicitly specify a new line. ATTACHMENTS is a string or a
cell array of strings listing files to send along with the message. Only TO
and SUBJECT are required.
SENDMAIL relies on two preferences, "Internet:SMTP_Server", your mail
server, and "Internet:E_mail", your e-mail address. Use SETPREF to set
these before using SENDMAIL. The easiest ways to identify your outgoing
mail server is to look at the preferences of another e-mail application or
consult your administrator. If you cannot find out your server's name,
setting it to just 'mail' might work. If you do not set these preferences
SENDMAIL will try to determine them automatically by reading environment
Variables and the Windows registry.
Example:
setpref('Internet','SMTP_Server','mail.example.com');
setpref('Internet','E_mail','matt@example.com');
sendmail('user@example.com','Calculation complete.')
sendmail({'matt@example.com','peter@example.com'},'You''re cool!', ...
'See the attached files for more info.',{'attach1.m','d:\attach2.doc'});
sendmail('user@example.com','Adding additional breaks',['one' 10 'two']);
sendmail('user@example.com','Specifying exact lines',{'one','two'});
See also web, ftp.
Reference page in Help browser
doc sendmail
Zip file access
<zip> - Compress files into zip file.
ZIP Compress files into zip file.
ZIP(ZIPFILENAME, FILES) creates a zip file with the name ZIPFILENAME
from the list of files and directories specified in FILES. Relative
paths are stored in the zip file, but absolute paths are not.
Directories recursively include all of their content.
ZIPFILENAME is a string specifying the name of the zip file. The '.zip'
extension is appended to ZIPFILENAME if omitted.
FILES is a string or cell array of strings that specify the files or
directories to be included in ZIPFILENAME. Individual files that are
on the MATLABPATH can be specified as partial pathnames. Otherwise an
Individual file can be specified relative to the current directory or
with an absolute path. Directories must be specified relative to the
current directory or with absolute paths. On UNIX systems, directories
may also start with a "~/" or a "~username/", which expands to the
current user's home directory or the specified user's home directory,
respectively. The wildcard character '*' may be used when specifying
files or directories, except when relying on the MATLABPATH to resolve
a filename or partial pathname.
ZIP(ZIPFILENAME, FILES, ROOTDIR) allows the path for FILES to be
specified relative to ROOTDIR rather than the current directory.
ENTRYNAMES = ZIP(...) returns a string cell array of the relative path
entry names contained in ZIPFILENAME.
Example
-------
% Zip all *.m and *.mat files in the current directory
% to the file backup.zip
zip('backup',{'*.m','*.mat'});
See also gzip, gunzip, tar, untar, unzip.
Reference page in Help browser
doc zip
<unzip> - Extract contents of zip file.
UNZIP Extract contents of zip file.
UNZIP(ZIPFILENAME) extracts the archived contents of ZIPFILENAME into
the current folder, preserving the files' attributes and timestamps.
ZIPFILENAME is a string specifying the name of the zip file. If
ZIPFILENAME does not include the full path, UNZIP searches for the file
in the current folder and along the MATLAB path. If you do not specify
the file extension, UNZIP appends .zip.
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, UNZIP overwrites
the existing files with the archived versions. If you do not have write
permission, UNZIP issues a warning.
UNZIP(ZIPFILENAME, OUTPUTDIR) extracts the contents of ZIPFILENAME into
the folder OUTPUTDIR.
UNZIP(URL, ...) extracts the zip contents from an Internet URL. The URL
must include the protocol type (e.g., "http://"). The UNZIP function
downloads the URL to the temporary folder on your system, and deletes
the URL on cleanup.
FILENAMES = UNZIP(...) 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.
Unsupported zip files
---------------------
UNZIP does not support password-protected or encrypted zip archives.
Examples
--------
% Copy the demo MAT-files to the folder 'archive'.
% Zip the demo MAT-files to demos.zip
rootDir = fullfile(matlabroot, 'toolbox', 'matlab', 'demos');
zip('demos.zip', '*.mat', rootDir)
% Unzip demos.zip to the folder 'archive'
unzip('demos.zip', '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')
See also fileattrib, gzip, gunzip, tar, untar, zip.
Reference page in Help browser
doc unzip