Normalize vector in 3D space

10 vues (au cours des 30 derniers jours)
Jennifer Fayad
Jennifer Fayad le 25 Jan 2019
Hello,
I'm trying to normalize a vector in 3d space into a unit vector

Réponses (2)

Matt J
Matt J le 25 Jan 2019
Modifié(e) : Matt J le 25 Jan 2019
X= v./sqrt( sum(v.^2,2) );

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

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by