Matt J
Posts:
4,992
Registered:
11/28/09


Re: Efficiently computing large numbers of vector norms
Posted:
Nov 9, 2012 9:49 AM


"Matt J" wrote in message <k7hksg$etp$1@newscl01ah.mathworks.com>... > > In your case, this would lead to > > result = sum( abs( KronProd(A2',A1')*X2 ).^2 , 2) ;
Make that
result = sum( abs( KronProd({A2',A1'})*X2 ).^2 , 2) ;
> then the whole thing gets even simpler/faster > > rownorms = @(M) sum(abs(M).^2); > > result=kron(rownorms(A2'*XX2) , rownorms(A1'*XX1));
And make that
rownorms = @(M) sum(abs(M).^2 , 2);

