2013年2月14日木曜日

RでEuclidian Norm

> x1 <- 1:3
> norm(as.matrix(x1), "F") 
[1] 3.741657
> x2 <- 1:2
> norm(as.matrix(x2),"F")
[1] 2.236068


参考
http://stackoverflow.com/questions/10933945/how-to-calculate-the-euclidean-norm-of-a-vector-in-r

0 件のコメント:

コメントを投稿