let x = [1 2 3;4 5 6], then why norm(x,2)is different fromnorm(x(:),2)
x = [1 2 3;4 5 6]
norm(x,2)
norm(x(:),2)
norm(x,2) = 9.5080and norm(x(:),2)=9.5394.
norm(x,2) = 9.5080
norm(x(:),2)=9.5394
I launched this program in Matlab R2012a.
As defined in Matlab's help for the norm, the return value is the “largest singular value” for matrices and sum(abs(A).^2)^(1/2)for vectors.
sum(abs(A).^2)^(1/2)
Additional reading: wikipedia - matrix norm
x(:) - , ., Matlab, . x - . 2- 2- -, 2- 2- . . .
x(:)
x
2- ? , , , SO, .