The norm command gives the exact value for vectors
Input: norm([1,2,3,-4])
Output: sqrt(30)
For a matrix, though, it returns an approximation.
Input: norm([[1,2],[3,-4]])
Output: 5.11667273602
I get the same result for l2norm in both cases.
The manual (section l2 matrix norm) indicates that it should be exact.
norm returns the approximate norm of a matrix
Modérateur : xcasadmin
Re: norm returns the approximate norm of a matrix
norm or l2norm on a matrix returns the norm induced by the L2 norm on the vector space where the matrix acts, like matrix_norm(.,2). That must be numeric.
Run frobenius_norm to get sqrt(30).
The French doc seems accurate, while the English doc should probably be completed.
Run frobenius_norm to get sqrt(30).
The French doc seems accurate, while the English doc should probably be completed.