I needed to normalize the eigenvectors of a matrix. (I did not see an option to do this so far in LinearAlgebra). So I figured I just need to map LinearAlgebra:-VectorNorm(x,'Euclidean') of each vector of the generated eigenvectors matrix,. Where x here means the vector in the matrix. But do not see a way to do it.
I ended up just using seq, which works fine. But was wondering if there is a way to do it? map function on each column (or each row) and have the result be matrix ofcourse.
Will show my attempt using map, and then using seq
Just doing the following does not work ofcourse
map( x->x/LinearAlgebra:-VectorNorm(x,'Euclidean'), v)
So I used seq
normalized:=[seq( v(..,i)/LinearAlgebra:-VectorNorm(v(..,i),'Euclidean'),i=1..LinearAlgebra:-RowDimension(v) )];
Will be nice if one can use map or variation of it, which works on either columns or rows at a time.