Difference between revisions of "MATLAB: Unit vectors"
From Robotics
Line 1: | Line 1: | ||
{{MatlabNavigation|previous=[[MATLAB: Vector algebra|Vector algebra]]|article=[[Unit vectors]]|next=[[MATLAB: Simple arithmetic operations|Simple arithmetic operations]]}} | {{MatlabNavigation|previous=[[MATLAB: Vector algebra|Vector algebra]]|article=[[Unit vectors]]|next=[[MATLAB: Simple arithmetic operations|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. Assuming there is an n-dimensional vector ''v'', the corresponding unit vector is computed as follows: | ||
+ | |||
+ | |||
[[Category:MATLAB]] | [[Category:MATLAB]] | ||
[[Category:Vectors]] | [[Category:Vectors]] |
Revision as of 10:28, 26 September 2014
← Previous: Vector algebra | 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. Assuming there is an n-dimensional vector v, the corresponding unit vector is computed as follows: