[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Empty Matrix Comparison
From: |
John W. Eaton |
Subject: |
Empty Matrix Comparison |
Date: |
Thu, 31 Aug 2006 20:14:06 -0400 |
On 31-Aug-2006, Larry Gewax wrote:
| Hello,
|
| I'm having an issue comparing a matrix to an empty matrix.
|
| In Octave 2.1.50 comparison to an empty matrix works:
|
| GNU Octave, version 2.1.50 (i686-pc-linux-gnu).
| Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 John W. Eaton.
| This is free software; see the source code for copying conditions.
| There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
| FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.
|
| Please contribute if you find this software useful.
| For more information, visit http://www.octave.org/help-wanted.html
|
| Report bugs to <address@hidden>.
|
| octave:1> a = [1,1]
| a =
|
| 1 1
|
| octave:2> a == []
| ans = 0
|
|
|
| In Octave 2.1.73 this is what I get:
|
| GNU Octave, version 2.1.73 (i686-pc-linux-gnu).
| Copyright (C) 2006 John W. Eaton.
| This is free software; see the source code for copying conditions.
| There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
| FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.
|
| Additional information about Octave is available at http://www.octave.org.
|
| Please contribute if you find this software useful.
| For more information, visit http://www.octave.org/help-wanted.html
|
| Report bugs to <address@hidden> (but first, please read
| http://www.octave.org/bugs.html to learn how to write a helpful report).
|
| octave:1> a = [1,1]
| a =
|
| 1 1
|
| octave:2> a == []
| error: mx_el_eq: nonconformant arguments (op1 is 1x2, op2 is 0x0)
| error: evaluating binary operator `==' near line 2, column 3
|
| This is causing problems for older scripts that we have.
| Could this be a compile issue or a new feature?
2.1.73 is correct here.
| Am I missing something that changed between versions?
Some bugs were fixed.
If you want to compare things that might have different sizes, you
might want to use isequal. There is a version in Octave Forge that
should work with 2.1.x. For 2.9.x, isequal is part of Octave.
jwe