1 function mag = vecmag2(vec)
3 % VECMAG2: Squared magnitude of a set of vectors.
11 % vec : An array of column vectors represented by a matrix of
12 % size (dim,nv), where dim is the dimension of the vector and
13 % nv the number of vectors.
17 % mvec : Squared magnitude of the vectors, vector of size (1,nv).
21 % Determines the squared magnitude of the vectors.
25 % Find the squared magnitude of the two vectors (0.0,2.0,1.3)
28 % mvec = vecmag2([0.0 1.5; 2.0 3.4; 1.3 2.3]);
30 % Copyright (C) 2000 Mark Spink
32 % This program is free software: you can redistribute it and/or modify
33 % it under the terms of the GNU General Public License as published by
34 % the Free Software Foundation, either version 2 of the License, or
35 % (at your option) any later version.
37 % This program is distributed in the hope that it will be useful,
38 % but WITHOUT ANY WARRANTY; without even the implied warranty of
39 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 % GNU General Public License for more details.
42 % You should have received a copy of the GNU General Public License
43 % along with this program. If not, see <http://www.gnu.org/licenses/>.