Vector and matrix operators. Array addition

Страницы работы

Содержание работы

|Vector and matrix operators

The following operators have special meanings for vectors and matrices. Many of these operators are available from the symbol toolbar, but all have corresponding keystrokes. Note that operators which expect vectors always expect column vectors rather than row vectors.

Operator:

Keystroke:

addition

 +

cross product

 Ctrl+8

determinant

 |

division

 /

inner (dot) product

 *

inverse

 ^-1

magnitude

 |

multiplication

 *

powers of matrix

  ^

negation

 -

subscript (vector)

 [

subscript (matrix)

 [

subtraction

 -

sum elements

 Ctrl+4

superscript

 Ctrl+6

transpose

 Ctrl+1

vectorize

 Ctrl+-

 Array addition

Keystroke: +

A + B

Adds the elements of A to the corresponding elements of B.

A + x

Adds x to every element in A.

Operands:


b.gifA and B are arrays with the same number of rows and columns.

b.gifThe elements of A and B must have the same dimensions.

b.gifx is any scalar, real or complex.

b.gifx must have the same dimensions as the elements of A.

Vector cross product

Keystroke: Ctrl+8

roaxb.gif

Returns the vector cross product of u and v.

Operands:


b.gifBoth u and v are three element column vectors.

roaxb.gifis a vector with the following properties:

b.gifIts direction is orthogonal to u and v in the direction determined by the right hand rule.

b.gifIts magnitude is | u || v |sin(s_theta.gif) where s_theta.gifis the angle between u and v.

Keystroke: |

| M |

Returns the determinant of a square matrix.

Operands:


b.gifM is a square matrix.

To take the magnitude of each element in a matrix,

b.gifPlace the | M | between the editing lines.

b.gifApply the vectorize operator, Ctrl+-.

Although you can use the determinant operator to find numerical determinants, you can also find symbolic determinants.

Matrix division

Keystroke: /

ramatdiv.gif

Divides every element of A by z.

Operands:

b.gifIf A is a matrix

b.gifz is a nonzero scalar

To divide every element of an m x n matrix A by the corresponding element of another m x n matrix B select the entire expression and press Ctrl+- to insert the vectorize operator.

Keystroke: *

roudotv.gif

Returns the vector inner product (sometimes called a "dot product") of u and v.

Operands:


b.gifBoth u and v are vectors having the same number of elements.

The inner product (or dot product) is a scalar formed by multiplying corresponding elements of u and v and summing the results. The inner product has the following properties:

b.gifroudotv.gif=| u || v |cos(q) where q is the angle between u and v.

b.gifWhen u and v are orthogonal, their inner product is zero.

b.gifThe inner product of u with itself is simply the square of the length of u.

Keystroke: ^-1

romatinv.gif

This returns the inverse of a matrix. If M does not have an inverse, you'll see an appropriate error message.

Operands:


b.gifM is a square matrix having an inverse.

Vector magnitude

Keystroke: |

| v |

Returns the magnitude of the vector v. This is the square root of the sum of the squared magnitude of the elements in v.

Operands:


b.gifv is a vector

To take the magnitude of each element in a vector:

1.  Place the | v | between the editing lines.

2.  Apply the vectorize operator, Ctrl+-.

Keystroke: *

ramatx.gif

Returns the matrix product of A and B.

Operands:


b.gifIf A is an m x n matrix

b.gifB is an n x p matrix

Notes:

·  If A is a matrix and x is scalar, then the product of A and x is a matrix in which each element of A has been multiplied by x.

·  To get the term by term product of two equal size arrays A and B, select the entire expression and press Ctrl+- to insert the vectorize operator.

Keystroke: ^

romton.gif

Depending on n, this returns one of the following:

Похожие материалы

Информация о работе