Normalize vector in 3D space

Hello,
I'm trying to normalize a vector in 3d space into a unit vector

Answers (2)

Matt J
Matt J on 25 Jan 2019
Edited: Matt J on 25 Jan 2019
X= v./sqrt( sum(v.^2,2) );
V = V./norm(V);
The default for norm is the 2-norm, so what you want.

Categories

Asked:

on 25 Jan 2019

Answered:

on 26 Jan 2019

Community Treasure Hunt

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

Start Hunting!