Normalize vector in 3D space

조회 수: 10 (최근 30일)
Jennifer Fayad
Jennifer Fayad 2019년 1월 25일
답변: John D'Errico 2019년 1월 26일
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