Normalize vector in 3D space

10 visualizzazioni (ultimi 30 giorni)
Jennifer Fayad
Jennifer Fayad il 25 Gen 2019
Risposto: John D'Errico il 26 Gen 2019
Hello,
I'm trying to normalize a vector in 3d space into a unit vector

Risposte (2)

Matt J
Matt J il 25 Gen 2019
Modificato: Matt J il 25 Gen 2019
X= v./sqrt( sum(v.^2,2) );

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

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by