Take a vector and convert it to a unit vector (normalize)

バージョン 1.3.0.0 (1.58 KB) 作成者: James West
normalize a vector to a unit vector
ダウンロード: 1.5K
更新 2010/8/31

ライセンスの表示

This function will take a [1xn] or [mx1] vector and normalize it to a unit vector length.

To use this function [vectorOut] = fcn_createUnitVector(vectorIn)

Error checking is performed to test for NaN values in the output, and a square root of the sum of the squares == 1

This function will take column or row vectors and output in said format.

引用

James West (2024). Take a vector and convert it to a unit vector (normalize) (https://www.mathworks.com/matlabcentral/fileexchange/28605-take-a-vector-and-convert-it-to-a-unit-vector-normalize), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2009b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCalculus についてさらに検索
タグ タグを追加
謝辞

ヒントを与えたファイル: Normalize N-D Vectors in Single Matrix or N Component Matrices

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.3.0.0

Added error checking
Added output format equal to input format
Added ability to handle multi-dimensional arrays.

1.2.0.0

Changed the code to operate in n dimensions.
It will now transform your vector back to its original notation
Error checking is now done to detect irregular calculations, and NaN values in the output
Changed the name to be more accessible.

1.0.0.0