Normalize vector in 3D space

14 次查看(过去 30 天)
Jennifer Fayad
Jennifer Fayad 2019-1-25
Hello,
I'm trying to normalize a vector in 3d space into a unit vector

回答(2 个)

Matt J
Matt J 2019-1-25
编辑:Matt J 2019-1-25
X= v./sqrt( sum(v.^2,2) );

John D'Errico
John D'Errico 2019-1-26
V = V./norm(V);
The default for norm is the 2-norm, so what you want.

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by