help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

norm and a question


From: Gorazd Brumen
Subject: norm and a question
Date: Sat, 12 Nov 2005 12:47:13 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920

Hi!

First question: Is it possible to do a 2-norm of each column vector in a matrix without a for loop?

Second: I have noticed this funny behavior:

octave:31> A = rand (5);
octave:32> norm (A, 1:2)
octave:33> A = rand (5,1);
octave:34> norm (A,1:2)
error: operator .^: nonconformant arguments (op1 is 5x1, op2 is 1x2)
error: evaluating binary operator `.^' near line 95, column 33
error: evaluating argument list element number 1
error: evaluating binary operator `^' near line 95, column 39
error: evaluating assignment expression near line 95, column 18
error: evaluating if command near line 90, column 9
error: evaluating if command near line 81, column 7
error: evaluating if command near line 80, column 5
error: evaluating if command near line 78, column 3
error: called from `norm' in file `/usr/share/octave/2.1.71/m/linear-algebra/norm.m'


i.e. in line 32, there is no reply (ok, sensible, since A is a matrix and 1:2 norm doesnt make
sense, maybe a warning would be in order).
but when one does the same thing with a vector (line 34) you get a funny reply from norm function.
this is really confusing when debugging.


versions: octave 2.1.71 on Debian unstable


regards,
g.


--
Gorazd Brumen
Mail: address@hidden
WWW: http://valjhun.fmf.uni-lj.si/~brumen
PGP: Key at http://pgp.mit.edu, ID BCC93240



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]