Difference between revisions of "MATLAB: Unit vectors"

From Robotics
Jump to: navigation, search
Line 5: Line 5:
  
 
[[File:matlab-va-unit.png|400px]]
 
[[File:matlab-va-unit.png|400px]]
 +
 +
Applying the ''norm''-function to the new vector ''ve'' proves that is has length 1. The described approach works for vectors of any dimension.
  
 
[[Category:MATLAB]]
 
[[Category:MATLAB]]
 
[[Category:Vectors]]
 
[[Category:Vectors]]

Revision as of 10:35, 26 September 2014

← Previous: Vector algebra Matlab.png Web interface  |  MATLAB overview  |  Back to article: Unit vectors Next: Simple arithmetic operations


Like explained in the article, you have to divide a vector by its magnitude to obtain the corresponding unit vector. This is exactly how it has to be done in MATLAB. Therefor the norm-function presented before is used. For an existing vector v, the corresponding unit vector ve is computed as follows:

Matlab-va-unit.png

Applying the norm-function to the new vector ve proves that is has length 1. The described approach works for vectors of any dimension.