Skip to contents

L2 normalize an input vector x to a length of 1

Usage

l2_normalize(x)

Arguments

x

a numeric vector

Value

a vector of length length(x) with a magnitude of 1