ops.txt >> 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 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. >> >> 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 one where the relation is true and elements set to zero where it is not. A and B must have the same dimensions unless one is a scalar. A scalar can be compared with anything. & Logical AND. A & B is a matrix whose elements are 1's where both A and B have non-zero elements, and 0's where either has a zero element. A and B must have the same dimensions unless one is a scalar. A scalar can be operate with anything. | Logical OR. A | B is a matrix whose elements are 1's where either A or B has a non-zero element, and 0's where both have zero elements. A and B must have the same dimensions unless one is a scalar. A scalar can be operate with anything. ~ Logical complement (NOT). ~A is a matrix whose elements are 1's where A has zero elements, and 0's where A has non-zero elements. xor Exclusive OR. xor(A,B) is 1 where either A or B, but not both, is non-zero. See XOR. >> >> >> help * 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. and - Logical AND & or - 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 - Parentheses and subscripting ( ) paren - Brackets [ ] paren - Braces and subscripting { } paren - Braces and subscripting { } 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. >> diary off