|
SOLUTIONS
|
Mathematica
>
Mathematics and Algorithms
>
Matrices and Linear Algebra
>
Operations on Vectors
>
UnitVector
BUILT-IN MATHEMATICA SYMBOL
UnitVector
UnitVector[k]
gives the two-dimensional unit vector in the k
direction.
UnitVector[n, k]
gives the n-dimensional unit vector in the k
direction.
Details and OptionsDetails and Options
- UnitVector[n, k] is a list of length n with a 1 in position k and 0s elsewhere.
- UnitVector by default creates a vector containing exact integers.
- The option WorkingPrecision can be used to specify the precision of vector components.
New in 6 | Last modified in 7
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
