MATHEMATICA TUTORIAL

# Vector Operations

 v[[i]] or Part[v,i] give the i element in the vector v c v scalar multiplication of c times the vector v u.v dot product of two vectors Norm[v] give the norm of v Normalize[v] give a unit vector in the direction of v Standardize[v] shift v to have zero mean and unit sample variance Standardize[v,f1] shift v by and scale to have unit sample variance

Basic vector operations.

This is a vector in three dimensions.
 Out[1]=
This gives a vector in the direction opposite to with twice the magnitude.
 Out[2]=
This reassigns the first component of to be its negative.
 Out[3]=
This gives the dot product of and .
 Out[4]=
This is the norm of .
 Out[5]=
This is the unit vector in the same direction as .
 Out[6]=
This verifies that the norm is 1.
 Out[7]=
Transform to have zero mean and unit sample variance.
 Out[8]=
This shows the transformed values have mean 0 and variance 1.
 Out[9]=

Two vectors are orthogonal if their dot product is zero. A set of vectors is orthonormal if they are all unit vectors and are pairwise orthogonal.

 Projection[u,v] give the orthogonal projection of u onto v Orthogonalize[{v1,v2,...}] generate an orthonormal set from the given list of vectors

Orthogonal vector operations.

This gives the projection of onto .
 Out[10]=
is a scalar multiple of .
 Out[11]=
is orthogonal to .
 Out[12]=
Starting from the set of vectors , this finds an orthonormal set of two vectors.
 Out[13]=
When one of the vectors is linearly dependent on the vectors preceding it, the corresponding position in the result will be a zero vector.
 Out[14]=

## Tutorial CollectionTutorial Collection

New to Mathematica? Find your learning path »
Have a question? Ask support »