[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
norm, 'fro' - warning: division by zero
From: |
Zbigniew Komarnicki |
Subject: |
norm, 'fro' - warning: division by zero |
Date: |
Fri, 26 Sep 2008 21:24:49 +0200 |
User-agent: |
KMail/1.9.9 |
Hello,
Please see on this code in octave:
octave-3.0.1 and octave-3.0.2 in Debian lenny.
Here is an example:
=========================
octave:1> A=zeros(5)
A =
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
octave:2> norm(A, 'fro')
warning: division by zero
ans = NaN
octave:3>
But when, according to the manual (help norm) write in this way:
>From help system:
P = `"fro"'
Frobenius norm of A, `sqrt (sum (diag (A' * A)))'.
=========================
octave:5> sqrt (sum (diag (A' * A)))
ans = 0
octave:6>
Here no warning 'division by zero' and answer is 0 not NaN.
It is a bug in 'norm' implementation or something else?
Thank you, for any comments.
Best wishes,
Zbigniew
- norm, 'fro' - warning: division by zero,
Zbigniew Komarnicki <=