HELP On-line help, display text at command line.
HELP, by itself, lists all primary help topics. Each primary topic
corresponds to a directory name on the MATLABPATH.

"HELP TOPIC" gives help on the specified topic. The topic can be a
command name, a directory name, or a MATLABPATH relative partial
pathname (see HELP PARTIALPATH). If it is a command name, HELP
displays information on that command. If it is a directory name,
HELP displays the Table-Of-Contents for the specified directory.
For example, "help general" and "help matlab/general" both list
the Table-Of-Contents for the directory toolbox/matlab/general.

HELP FUN displays the help for the function FUN.

T = HELP('topic') returns the help text in a '\n' separated string.

LOOKFOR XYZ looks for the string XYZ in the first comment line
of the HELP text in all M-files found on the MATLABPATH. For all
files in which a match occurs, LOOKFOR displays the matching lines.

MORE ON causes HELP to pause between screenfuls if the help text
runs to several screens.

In the online help, keywords are capitalized to make them stand
out. Always type commands in lowercase since all command and
function names are actually in lowercase.

See also LOOKFOR, WHAT, WHICH, DIR, MORE.

HELPWIN On-line help, separate window for navigation.
HELPWIN TOPIC opens a help window and displays the help text for the
given TOPIC. Links are created to functions referenced in the 'See Also'
line of the help text.

HELPWIN(HELP_STR,TITLE) displays the string HELP_STR in the help
window. HELP_STR may be passed in as a string with each line separated
by carriage returns, a column vector cell array of strings with each cell
(row) representing a line or as a string matrix with each row representing
a line. The optional string TITLE will appear in the title edit box.

HELPWIN({TITLE1 HELP_STR1;TITLE2 HELP_STR2;...},PAGE) displays one page
of multi-page help text. The multi-page help text is passed in as a
cell array of strings or cells containing TITLE and HELP_STR pairs.
Each row of the multi-page help text cell array (dimensioned number of
pages by 2) consists of a title string paired with a string, cell array
or string matrix of help text. The second argument PAGE is a string
which must match one of the TITLE entries in the multi-page help text.
The matching TITLE represents the page that is to be displayed first.
If no second argument is given, the first page is displayed.

A third argument may be passed to HELPWIN which is a string that becomes
the title of the help window figure.

Additional arguments, after the window title, will be interpreted as
Handle Graphics parameter-value pairs to be applied to the text displayed
in the help window.

Examples.
helpwin plot
helpwin('Help String','title')
helpwin(['Help text for' sprintf('\n') 'my m-file.'],'title')
helpwin({'Help String for';'my m-file'},'title')
helpwin(str,'Topic 2','My Title')
where,
str = { 'Topic 1' 'Help string for Topic 1';
'Topic 2' 'Help string for Topic 2';
'Topic 3' 'Help string for Topic 3' }

See also DOC, DOCOPT, HELP, WEB.

MORE Control paged output in command window.
MORE OFF disables paging of the output in the MATLAB command window.
MORE ON enables paging of the output in the MATLAB command window.
MORE(N) specifies the size of the page to be N lines.

When MORE is enabled and output is being paged, advance to the next
line of output by hitting the RETURN key; get the next page of
output by hitting the spacebar. Press the "q" key to exit out
of displaying the current item.

LOOKFOR Search all M-files for keyword.
LOOKFOR XYZ looks for the string XYZ in the first comment line
(the H1 line) of the HELP text in all M-files found on MATLABPATH.
For all files in which a match occurs, LOOKFOR displays the H1 line.

For example, "lookfor inverse" finds at least a dozen matches,
including the H1 lines containing "inverse hyperbolic cosine"
"two-dimensional inverse FFT", and "pseudoinverse".
Contrast this with "which inverse" or "what inverse", which run
more quickly, but which probably fail to find anything because
MATLAB does not ordinarily have a function "inverse".

LOOKFOR XYZ -all searches the entire first comment block of
each M-file.

In summary, WHAT lists the functions in a given directory,
WHICH finds the directory containing a given function or file, and
LOOKFOR finds all functions in all directories that might have
something to do with a given key word.

See also DIR, HELP, WHO, WHAT, WHICH.

DATE Current date as date string.
S = DATE returns a string containing the date in dd-mmm-yyyy format.

See also NOW, CLOCK, DATENUM.

DEMO Run demonstrations.

Type "demo" at the command line to browse available demos.

With the optional action argument demo
('matlab'|'toolbox'|'simulink'|'blockset'|'stateflow'),
DEMO opens the demo screen to the specified subtopic.

With the optional categoryArg argument,
DEMO opens to the specified toolbox or category, e.g.
demo toolbox signal
demo matlab language

CLC Clear command window.
CLC clears the command window and homes the cursor.

See also HOME.

ANS Most recent answer.
ANS is the variable created automatically when expressions
are not assigned to anything else. ANSwer.

WHO List current variables.
WHO lists the variables in the current workspace.
WHOS lists more information about each variable.
WHO GLOBAL and WHOS GLOBAL list the variables in the global workspace.
WHO -FILE FILENAME lists the variables in the specified .MAT file.

WHO ... VAR1 VAR2 restricts the display to the variables specified.
The wildcard character '*' can be used to display variables that
match a pattern. For instance, WHO A* finds all variables in the
current workspace that start with A.

Use the functional form of WHO, such as WHO('-file',FILE,V1,V2),
when the filename or variable names are stored in strings.

S = WHO(...) returns a cell array containing the names of the
variables in the workspace or file. You must use the functional
form of WHO when there is an output argument.

See also WHOS.

CLEAR Clear variables and functions from memory.
CLEAR removes all variables from the workspace.
CLEAR VARIABLES does the same thing.
CLEAR GLOBAL removes all global variables.
CLEAR FUNCTIONS removes all compiled M-functions.
CLEAR MEX removes all links to MEX-files.
CLEAR ALL removes all variables, globals, functions and MEX links.

CLEAR VAR1 VAR2 ... clears the variables specified. The wildcard
character '*' can be used to clear variables that match a pattern.
For instance, CLEAR X* clears all the variables in the current
workspace that start with X.

If X is global, CLEAR X removes X from the current workspace,
but leaves it accessible to any functions declaring it global.
CLEAR GLOBAL X completely removes the global variable X.

CLEAR FUN clears the function specified.

CLEAR ALL also has the side effect of removing all debugging
breakpoints since the breakpoints for a file are cleared whenever
the m-file changes or is cleared.

Use the functional form of CLEAR, such as CLEAR('name'),
when the variable name or function name is stored in a string.

See also WHO, WHOS.

PWD Show (print) current working directory.
PWD displays the current working directory.

S = PWD returns the current directory in the string S.

See also CD.

DIR List directory.
DIR directory_name lists the files in a directory. Pathnames and
wildcards may be used. For example, DIR *.m lists all the M-files
in the current directory.

D = DIR('directory_name') returns the results in an M-by-1
structure with the fields:
name -- filename
date -- modification date
bytes -- number of bytes allocated to the file
isdir -- 1 if name is a directory and 0 if not

See also WHAT, CD, TYPE, DELETE.

WHAT List MATLAB-specific files in directory.
The command WHAT, by itself, lists the M-files, MAT-files
and MEX-files in the current working directory.

The command WHAT DIRNAME lists the files in directory dirname on
the MATLABPATH. It is not necessary to give the full path name of
the directory; a MATLABPATH relative partial pathname can be
specified instead (see PARTIALPATH). For example, "what general"
and "what matlab/general" both list the M-files in directory
toolbox/matlab/general.

W = WHAT('directory') returns the results of WHAT in a structure
array with the fields:
path -- path to directory
m -- cell array of m-file names.
mat -- cell array of mat-file names.
mex -- cell array of mex-file names.
mdl -- cell array of mdl-file names.
p -- cell array of p-file names.
classes -- cell array of class names.

See also DIR, WHO, WHICH, LOOKFOR.

CD Change current working directory.
CD directory-spec sets the current directory to the one specified.
CD .. moves to the directory above the current one.
CD, by itself, prints out the current directory.

WD = CD returns the current directory as a string.

Use the functional form of CD, such as CD('directory-spec'),
when the directory specification is stored in a string.

See also PWD.

TYPE List M-file.
TYPE foo.bar lists the ascii file called 'foo.bar'.
TYPE foo lists the ascii file called 'foo.m'.

If files called foo and foo.m both exist, then
TYPE foo lists the file 'foo', and
TYPE foo.m list the file 'foo.m'.

TYPE FILENAME lists the contents of the file given a full pathname
or a MATLABPATH relative partial pathname (see PARTIALPATH).

See also DBTYPE, PARTIALPATH.

PATH Get/set search path.
PATH, by itself, prettyprints MATLAB's current search path. The
initial search path list is set by PATHDEF, and is perhaps
individualized by STARTUP.

P = PATH returns a string containing the path in P.
PATH(P) changes the path to P. PATH(PATH) forces the path cache
to be rebuilt.

PATH(P1,P2) changes the path to the concatenation of the two path
strings P1 and P2. Thus PATH(PATH,P) appends a new directory to
the current path and PATH(P,PATH) prepends a new path. If P1 or
P2 are already on the path, they are not added.

For example, the following statements add another directory
to MATLAB's search path on various operating systems:

Unix: path(path,'/home/myfriend/goodstuff')
VMS: path(path,'DISKS1:[MYFRIEND.GOODSTUFF]')
DOS: path(path,'TOOLS\GOODSTUFF')
Mac: path(path,'HardDisk:Tools:GoodStuff:')

See also WHAT, CD, DIR, ADDPATH, RMPATH.

ADDPATH Add directory to search path.
ADDPATH DIRNAME prepends the specified directory to the current
matlabpath. Surround the DIRNAME in quotes if the name contains a
space.

ADDPATH DIR1 DIR2 DIR3 ... prepends all the specified directories to
the path.

ADDPATH ... -END appends the specified directories.
ADDPATH ... -BEGIN prepends the specified directories.

Use the functional form of ADDPATH, such as ADDPATH('dir1','dir2',...),
when the directory specification is stored in a string.

Examples
addpath c:\matlab\work
addpath 'Macintosh HD:Matlab:My Tools'
addpath /home/user/matlab

See also RMPATH.

SCRIPT About MATLAB scripts and M-files.
A SCRIPT file is an external file that contains a sequence
of MATLAB statements. By typing the filename, subsequent
MATLAB input is obtained from the file. SCRIPT files have
a filename extension of ".m" and are often called "M-files".
To make a SCRIPT file into a function, see FUNCTION.

See also TYPE, ECHO.

EDIT Edit M-file.
EDIT MFILE opens the file MFILE.M in a text editor. MFILE must be the
name of an m-file or a MATLABPATH relative partial pathname (see
PARTIALPATH).

EDIT FILE.EXT opens the specified text file.

EDIT, by itself, opens up a new editor window.

SQRT Square root.
SQRT(X) is the square root of the elements of X. Complex
results are produced if X is not positive.

See also SQRTM.

Overloaded methods
help sym/sqrt.m

SIN Sine.
SIN(X) is the sine of the elements of X.

Overloaded methods
help sym/sin.m

COS Cosine.
COS(X) is the cosine of the elements of X.

Overloaded methods
help sym/cos.m

SAVE Save workspace variables to disk.
SAVE fname saves all workspace variables to the binary "MAT-file"
named fname.mat. The data may be retrieved with LOAD. Omitting the
filename causes SAVE to use the default filename "matlab.mat".

SAVE fname X saves only X.
SAVE fname X Y Z saves X, Y, and Z. The wildcard '*' can be used to
save only those variables that match a pattern.

SAVE fname X Y Z -ascii uses 8-digit ASCII form instead of binary.
SAVE fname X Y Z -ascii -double uses 16-digit ASCII form.
SAVE fname X Y Z -ascii -double -tabs delimits with tabs.
SAVE fname X Y Z -v4 saves a MAT-file that MATLAB 4 can LOAD.
SAVE fname X Y Z -append adds the variables to an existing MAT-file.

Use the functional form of SAVE, such as SAVE('fname','var1','var2'),
when the filename or variable names are stored in strings.

See also LOAD, DIARY, FWRITE, FPRINTF.

LOAD Load workspace variables from disk.
LOAD FNAME retrieves the variables from the MAT-file 'fname.mat'.

LOAD FILENAME retrieves the variables from a MAT-file given a full
pathname or a MATLABPATH relative partial pathname (see
PARTIALPATH).

LOAD, by itself, loads from the file named 'matlab.mat'.

LOAD FNAME X Y Z ... loads just the specified variables. The
wildcard '*' can be used to load variables that match a pattern.

LOAD FNAME.EXT reads ASCII files that contain rows of space
separated values. The file can contain MATLAB-style comments that
begin with a percent character '%'. The resulting data is placed into
a variable with the same name as the file (without the extension).

LOAD FNAME -ASCII or LOAD FNAME -MAT can be used to force LOAD to
treat the file as either an ASCII file or a MAT file.

Use the functional form of LOAD, such as LOAD('fname'), when the
file name is stored in a string.

See also SAVE, WHOS, DLMREAD, SPCONVERT, FSCANF, FPRINTF, PARTIALPATH.

PI 3.1415926535897....
PI = 4*atan(1) = imag(log(-1)) = 3.1415926535897....

DIARY Save text of MATLAB session.
DIARY file_name causes a copy of all subsequent terminal input
and most of the resulting output to be written on the named
file. DIARY OFF suspends it. DIARY ON turns it back on.
DIARY, by itself, toggles the diary state.

Use the functional form of DIARY, such as DIARY('file'),
when the file name is stored in a string.