>> help HELP topics matlab/general - General purpose commands. matlab/ops - Operators and special characters. matlab/lang - Programming language constructs. matlab/elmat - Elementary matrices and matrix manipulation. matlab/elfun - Elementary math functions. matlab/specfun - Specialized math functions. matlab/matfun - Matrix functions - numerical linear algebra. matlab/datafun - Data analysis and Fourier transforms. matlab/polyfun - Interpolation and polynomials. matlab/funfun - Function functions and ODE solvers. matlab/sparfun - Sparse matrices. matlab/scribe - Annotation and Plot Editing. matlab/graph2d - Two dimensional graphs. matlab/graph3d - Three dimensional graphs. matlab/specgraph - Specialized graphs. matlab/graphics - Handle Graphics. matlab/uitools - Graphical user interface tools. matlab/strfun - Character strings. matlab/imagesci - Image and scientific data input/output. matlab/iofun - File input and output. matlab/audiovideo - Audio and Video support. matlab/timefun - Time and dates. matlab/datatypes - Data types and structures. matlab/verctrl - Version control. matlab/codetools - Commands for creating and debugging code. matlab/helptools - Help commands. matlab/demos - Examples and demonstrations. matlab/timeseries - Time series data visualization and exploration. matlab/hds - (No table of contents file) toolbox/local - Preferences. shared/controllib - Control Library toolbox/optim - Optimization Toolbox shared/optimlib - Optimization Library >> help general General purpose commands. MATLAB Version 7.0.4 (R14SP2) 21-Jan-2005 General information. syntax - Help on MATLAB command syntax. demo - Run demonstrations. ver - MATLAB, Simulink and toolbox version information. version - MATLAB version information. Managing the workspace. who - List current variables. whos - List current variables, long form. clear - Clear variables and functions from memory. pack - Consolidate workspace memory. load - Load workspace variables from disk. save - Save workspace variables to disk. saveas - Save Figure or model to desired output format. memory - Help for memory limitations. recycle - Set option to move deleted files to recycle folder. quit - Quit MATLAB session. exit - Exit from MATLAB. Managing commands and functions. what - List MATLAB-specific files in directory. type - List M-file. open - Open files by extension. which - Locate functions and files. pcode - Create pre-parsed pseudo-code file (P-file). mex - Compile MEX-function. inmem - List functions in memory. namelengthmax - Maximum length of MATLAB function or variable name. Managing the search path. path - Get/set search path. addpath - Add directory to search path. rmpath - Remove directory from search path. rehash - Refresh function and file system caches. import - Import Java packages into the current scope. finfo - Identify file type against standard file handlers on path. genpath - Generate recursive toolbox path. savepath - Save the current MATLAB path in the pathdef.m file. Managing the java search path. javaaddpath - Add directories to the dynamic java path. javaclasspath - Get and set java path. javarmpath - Remove directory from dynamic java path. Controlling the command window. echo - Echo commands in M-files. more - Control paged output in command window. diary - Save text of MATLAB session. format - Set output format. beep - Produce beep sound. desktop - Start and query the MATLAB Desktop. preferences - Bring up MATLAB user settable preferences dialog. Operating system commands. cd - Change current working directory. copyfile - Copy file or directory. movefile - Move file or directory. delete - Delete file or graphics object. pwd - Show (print) current working directory. dir - List directory. ls - List directory. fileattrib - Set or get attributes of files and directories. isdir - True if argument is a directory. mkdir - Make new directory. rmdir - Remove directory. getenv - Get environment variable. ! - Execute operating system command (see PUNCT). dos - Execute DOS command and return result. unix - Execute UNIX command and return result. system - Execute system command and return result. perl - Execute Perl command and return the result. computer - Computer type. isunix - True for the UNIX version of MATLAB. ispc - True for the PC (Windows) version of MATLAB. Debugging. debug - List debugging commands. mexdebug - Debug MEX-files. Tools to locate dependent functions of an M-file. depfun - Locate dependent functions of an M-file or P-file. depdir - Locate dependent directories of an M-file or P-file. Loading and calling shared libraries. calllib - Call a function in an external library. libpointer - Creates a pointer object for use with external libraries. libstruct - Creates a structure pointer for use with external libraries. libisloaded - True if the specified shared library is loaded. loadlibrary - Load a shared library into MATLAB. libfunctions - Return information on functions in an external library. libfunctionsview - View the functions in an external library. unloadlibrary - Unload a shared library loaded with LOADLIBRARY. java - Using Java from within MATLAB. usejava - True if the specified Java feature is supported in MATLAB. See also LANG, DATATYPES, IOFUN, GRAPHICS, OPS, STRFUN, TIMEFUN, MATFUN, DEMOS, GRAPHICS, DATAFUN, UITOOLS, DOC, PUNCT, ARITH. >> help ops Operators and special characters. Arithmetic operators. plus - Plus + uplus - Unary plus + minus - Minus - uminus - Unary minus - mtimes - Matrix multiply * times - Array multiply .* mpower - Matrix power ^ power - Array power .^ mldivide - Backslash or left matrix divide \ mrdivide - Slash or right matrix divide / ldivide - Left array divide .\ rdivide - Right array divide ./ kron - Kronecker tensor product kron Relational operators. eq - Equal == ne - Not equal ~= lt - Less than < gt - Greater than > le - Less than or equal <= ge - Greater than or equal >= Logical operators. Short-circuit logical AND && Short-circuit logical OR || and - Element-wise logical AND & or - Element-wise logical OR | not - Logical NOT ~ xor - Logical EXCLUSIVE OR any - True if any element of vector is nonzero all - True if all elements of vector are nonzero Special characters. colon - Colon : paren - Parentheses and subscripting ( ) paren - Brackets [ ] paren - Braces and subscripting { } punct - Function handle creation @ punct - Decimal point . punct - Structure field access . punct - Parent directory .. punct - Continuation ... punct - Separator , punct - Semicolon ; punct - Comment % punct - Invoke operating system command ! punct - Assignment = punct - Quote ' transpose - Transpose .' ctranspose - Complex conjugate transpose ' horzcat - Horizontal concatenation [,] vertcat - Vertical concatenation [;] subsasgn - Subscripted assignment ( ),{ },. subsref - Subscripted reference ( ),{ },. subsindex - Subscript index Bitwise operators. bitand - Bit-wise AND. bitcmp - Complement bits. bitor - Bit-wise OR. bitmax - Maximum floating point integer. bitxor - Bit-wise XOR. bitset - Set bit. bitget - Get bit. bitshift - Bit-wise shift. Set operators. union - Set union. unique - Set unique. intersect - Set intersection. setdiff - Set difference. setxor - Set exclusive-or. ismember - True for set member. See also ARITH, RELOP, SLASH, FUNCTION_HANDLE. >> help arith Arithmetic operators. + Plus. X + Y adds matrices X and Y. X and Y must have the same dimensions unless one is a scalar (a 1-by-1 matrix). A scalar can be added to anything. - Minus. X - Y subtracts matrix X from Y. X and Y must have the same dimensions unless one is a scalar. A scalar can be subtracted from anything. * Matrix multiplication. X*Y is the matrix product of X and Y. Any scalar (a 1-by-1 matrix) may multiply anything. Otherwise, the number of columns of X must equal the number of rows of Y. .* Array multiplication X.*Y denotes element-by-element multiplication. X and Y must have the same dimensions unless one is a scalar. A scalar can be multiplied into anything. ^ Matrix power. Z = X^y is X to the y power if y is a scalar and X is square. If y is an integer greater than one, the power is computed by repeated multiplication. For other values of y the calculation involves eigenvalues and eigenvectors. Z = x^Y is x to the Y power, if Y is a square matrix and x is a scalar, computed using eigenvalues and eigenvectors. Z = X^Y, where both X and Y are matrices, is an error. .^ Array power. Z = X.^Y denotes element-by-element powers. X and Y must have the same dimensions unless one is a scalar. A scalar can operate into anything. >> help relop Relational operators. < > Relational operators. The six relational operators are <, <=, >, >=, ==, and ~=. A < B does element by element comparisons between A and B and returns a matrix of the same size with elements set to logical 1 (TRUE) where the relation is true and elements set to logical 0 (FALSE) where it is not. A and B must have the same dimensions (or one can be a scalar). & Element-wise Logical AND. A & B is a matrix whose elements are logical 1 (TRUE) where both A and B have non-zero elements, and logical 0 (FALSE) where either has a zero element. A and B must have the same dimensions (or one can be a scalar). && Short-Circuit Logical AND. A && B is a scalar value that is the logical AND of scalar A and B. This is a "short-circuit" operation in that MATLAB evaluates B only if the result is not fully determined by A. For example, if A equals 0, then the entire expression evaluates to logical 0 (FALSE), regard- less of the value of B. Under these circumstances, there is no need to evaluate B because the result is already known. | Element-wise Logical OR. A | B is a matrix whose elements are logical 1 (TRUE) where either A or B has a non-zero element, and logical 0 (FALSE) where both have zero elements. A and B must have the same dimensions (or one can be a scalar). || Short-Circuit Logical OR. A || B is a scalar value that is the logical OR of scalar A and B. This is a "short-circuit" operation in that MATLAB evaluates B only if the result is not fully determined by A. For example, if A equals 1, then the entire expression evaluates to logical 1 (TRUE), regard- less of the value of B. Under these circumstances, there is no need to evaluate B because the result is already known. ~ Logical complement (NOT). ~A is a matrix whose elements are logical 1 (TRUE) where A has zero elements, and logical 0 (FALSE) where A has non-zero elements. xor Exclusive OR. xor(A,B) is logical 1 (TRUE) where either A or B, but not both, is non-zero. See XOR. >> help punct Punctuation. . Decimal point. 325/100, 3.25 and .325e1 are all the same. . Array operations. Element-by-element multiplicative operations are obtained using .* , .^ , ./ , .\ or .'. For example, C = A ./ B is the matrix with elements c(i,j) = a(i,j)/b(i,j). . Field access. A.field and A(i).field, when A is a structure, access the contents of the field with the name "field". If A isn't a scalar structure, this produces a comma separated list (see LISTS). You can nest structure access as in X(2).field(3).name. You can also combine structure, cell array, and paren subscripting if that makes sense for the arrays stored in the structure (see PAREN). .. Parent directory. See CD. ... Continuation. Three or more periods at the end of a line continue the current command or function call onto the next line. Three or more periods before the end of a line cause MATLAB to ignore the remaining text on the current line and continue the command or function call onto the next line. This effectively makes a comment out of anything on the current line that follows the periods. , Comma. The comma is used to separate matrix subscripts and arguments to functions. It is also used to separate statements in multi-statement lines. In this situation, it may be replaced by a semicolon to suppress printing. ; Semicolon. The semicolon is used inside brackets to indicate the ends of the rows of a matrix. It is also used after an expression or statement to suppress printing. % Percent. The percent symbol is used to begin comments. Logically, it serves as an end-of-line character. Any following text on the line is ignored or printed by the HELP system. ! Exclamation point. Any text following the '!' is issued as a command to the underlying computer operating system. On the PC, adding & to the end of the ! command line, as in !dir & causes the output to appear in a separate window and for the window to remain open after the command completes. ' Transpose. X' is the complex conjugate transpose of X. X.' is the non-conjugate transpose. ' Quote. 'ANY TEXT' is a vector whose components are the ASCII codes for the characters. A quote within the text is indicated by two quotes. For example: 'Don''t forget.' = Assignment. B = A stores the elements of A in B. @ At. The at symbol is used to create a function_handle. It is also used at the beginning of directory names that contain matlab object methods and the constructor for the object, e.g. the directory @inline contains the constructor inline.m for the inline object and all methods for inline objects. See also RELOP, COLON, LISTS, PAREN, CD, FUNCTION_HANDLE. >> help lang Programming language constructs. Control flow. if - Conditionally execute statements. else - Execute statement if previous IF condition failed. elseif - Execute if previous IF failed and condition is true. end - Terminate scope of control statements. for - Repeat statements a specific number of times. while - Repeat statements an indefinite number of times. break - Terminate execution of WHILE or FOR loop. continue - Pass control to the next iteration of a loop. switch - Switch among several cases based on expression. case - SWITCH statement case. otherwise - Default SWITCH statement case. try - Begin TRY block. catch - Begin CATCH block. return - Return to invoking function. error - Display message and abort function. rethrow - Reissue error. Evaluation and execution. eval - Execute string with MATLAB expression. evalc - Evaluate MATLAB expression with capture. feval - Execute the specified function. evalin - Evaluate expression in workspace. builtin - Execute built-in function from overloaded method. assignin - Assign variable in workspace. run - Run script. Scripts, functions, and variables. script - About MATLAB scripts and M-files. function - Add new function. global - Define global variable. persistent - Define persistent variable. mfilename - Name of currently executing M-file. lists - Comma separated lists. exist - Check if variables or functions are defined. mlock - Prevent M-file from being cleared. munlock - Allow M-file to be cleared. mislocked - True if M-file cannot be cleared. precedence - Operator Precedence in MATLAB. isvarname - True for valid variable name. iskeyword - Check if input is a keyword. javachk - Validate level of Java support. genvarname - Construct a valid MATLAB variable name from a string. Argument handling. nargchk - Validate number of input arguments. nargoutchk - Validate number of output arguments. nargin - Number of function input arguments. nargout - Number of function output arguments. varargin - Variable length input argument list. varargout - Variable length output argument list. inputname - Input argument name. Message display. warning - Display warning message. lasterr - Last error message. lasterror - Last error message and related information. lastwarn - Last warning message. disp - Display array. display - Display array. intwarning - Controls the state of the 4 integer warnings. Interactive input. input - Prompt for user input. keyboard - Invoke keyboard from M-file. See also GENERAL, IOFUN, OPS, DATATYPES, MATFUN, FUNFUN, ELFUN, POLYFUN. >> help elmat Elementary matrices and matrix manipulation. Elementary matrices. zeros - Zeros array. ones - Ones array. eye - Identity matrix. repmat - Replicate and tile array. rand - Uniformly distributed random numbers. randn - Normally distributed random numbers. linspace - Linearly spaced vector. logspace - Logarithmically spaced vector. freqspace - Frequency spacing for frequency response. meshgrid - X and Y arrays for 3-D plots. accumarray - Construct an array with accumulation. : - Regularly spaced vector and index into matrix. Basic array information. size - Size of array. length - Length of vector. ndims - Number of dimensions. numel - Number of elements. disp - Display matrix or text. isempty - True for empty array. isequal - True if arrays are numerically equal. isequalwithequalnans - True if arrays are numerically equal. Matrix manipulation. cat - Concatenate arrays. reshape - Change size. diag - Diagonal matrices and diagonals of matrix. blkdiag - Block diagonal concatenation. tril - Extract lower triangular part. triu - Extract upper triangular part. fliplr - Flip matrix in left/right direction. flipud - Flip matrix in up/down direction. flipdim - Flip matrix along specified dimension. rot90 - Rotate matrix 90 degrees. : - Regularly spaced vector and index into matrix. find - Find indices of nonzero elements. end - Last index. sub2ind - Linear index from multiple subscripts. ind2sub - Multiple subscripts from linear index. Multi-dimensional array functions. ndgrid - Generate arrays for N-D functions and interpolation. permute - Permute array dimensions. ipermute - Inverse permute array dimensions. shiftdim - Shift dimensions. circshift - Shift array circularly. squeeze - Remove singleton dimensions. Array utility functions. isscalar - True for scalar. isvector - True for vector. Special variables and constants. ans - Most recent answer. eps - Floating point relative accuracy. realmax - Largest positive floating point number. realmin - Smallest positive floating point number. pi - 3.1415926535897.... i, j - Imaginary unit. inf - Infinity. NaN - Not-a-Number. isnan - True for Not-a-Number. isinf - True for infinite elements. isfinite - True for finite elements. why - Succinct answer. Specialized matrices. compan - Companion matrix. gallery - Higham test matrices. hadamard - Hadamard matrix. hankel - Hankel matrix. hilb - Hilbert matrix. invhilb - Inverse Hilbert matrix. magic - Magic square. pascal - Pascal matrix. rosser - Classic symmetric eigenvalue test problem. toeplitz - Toeplitz matrix. vander - Vandermonde matrix. wilkinson - Wilkinson's eigenvalue test matrix. >> help elfun Elementary math functions. Trigonometric. sin - Sine. sind - Sine of argument in degrees. sinh - Hyperbolic sine. asin - Inverse sine. asind - Inverse sine, result in degrees. asinh - Inverse hyperbolic sine. cos - Cosine. cosd - Cosine of argument in degrees. cosh - Hyperbolic cosine. acos - Inverse cosine. acosd - Inverse cosine, result in degrees. acosh - Inverse hyperbolic cosine. tan - Tangent. tand - Tangent of argument in degrees. tanh - Hyperbolic tangent. atan - Inverse tangent. atand - Inverse tangent, result in degrees. atan2 - Four quadrant inverse tangent. atanh - Inverse hyperbolic tangent. sec - Secant. secd - Secant of argument in degrees. sech - Hyperbolic secant. asec - Inverse secant. asecd - Inverse secant, result in degrees. asech - Inverse hyperbolic secant. csc - Cosecant. cscd - Cosecant of argument in degrees. csch - Hyperbolic cosecant. acsc - Inverse cosecant. acscd - Inverse cosecant, result in degrees. acsch - Inverse hyperbolic cosecant. cot - Cotangent. cotd - Cotangent of argument in degrees. coth - Hyperbolic cotangent. acot - Inverse cotangent. acotd - Inverse cotangent, result in degrees. acoth - Inverse hyperbolic cotangent. Exponential. exp - Exponential. expm1 - Compute exp(x)-1 accurately. log - Natural logarithm. log1p - Compute log(1+x) accurately. log10 - Common (base 10) logarithm. log2 - Base 2 logarithm and dissect floating point number. pow2 - Base 2 power and scale floating point number. realpow - Power that will error out on complex result. reallog - Natural logarithm of real number. realsqrt - Square root of number greater than or equal to zero. sqrt - Square root. nthroot - Real n-th root of real numbers. nextpow2 - Next higher power of 2. Complex. abs - Absolute value. angle - Phase angle. complex - Construct complex data from real and imaginary parts. conj - Complex conjugate. imag - Complex imaginary part. real - Complex real part. unwrap - Unwrap phase angle. isreal - True for real array. cplxpair - Sort numbers into complex conjugate pairs. Rounding and remainder. fix - Round towards zero. floor - Round towards minus infinity. ceil - Round towards plus infinity. round - Round towards nearest integer. mod - Modulus (signed remainder after division). rem - Remainder after division. sign - Signum. >> help slash Matrix division. \ Backslash or left division. A\B is the matrix division of A into B, which is roughly the same as INV(A)*B , except it is computed in a different way. If A is an N-by-N matrix and B is a column vector with N components, or a matrix with several such columns, then X = A\B is the solution to the equation A*X = B computed by Gaussian elimination. A warning message is printed if A is badly scaled or nearly singular. A\EYE(SIZE(A)) produces the inverse of A. If A is an M-by-N matrix with M < or > N and B is a column vector with M components, or a matrix with several such columns, then X = A\B is the solution in the least squares sense to the under- or overdetermined system of equations A*X = B. The effective rank, K, of A is determined from the QR decomposition with pivoting. A solution X is computed which has at most K nonzero components per column. If K < N this will usually not be the same solution as PINV(A)*B. A\EYE(SIZE(A)) produces a generalized inverse of A. / Slash or right division. B/A is the matrix division of A into B, which is roughly the same as B*INV(A) , except it is computed in a different way. More precisely, B/A = (A'\B')'. See \. ./ Array right division. B./A denotes element-by-element division. A and B must have the same dimensions unless one is a scalar. A scalar can be divided with anything. .\ Array left division. A.\B. denotes element-by-element division. A and B must have the same dimensions unless one is a scalar. A scalar can be divided with anything. >>