octave-maintainers
[Top][All Lists]
Advanced

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

Re: make contourf work (again)


From: Kai Habel
Subject: Re: make contourf work (again)
Date: Sat, 06 Sep 2008 16:13:12 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20071114)

John W. Eaton schrieb:
On  6-Sep-2008, Kai Habel wrote:

| Hello,
| | with very recent checkout I see: | | octave:1> contourf(peaks) | warning: meaning may have changed due to change in precedence for && and | || operators
| error: patch: X and Y must be of same size
| error: called from:
| error: /home/kai/hg-octave/octave/scripts/plot/contourf.m at line 234, | column 5 | error: /home/kai/hg-octave/octave/scripts/plot/contourf.m at line 67, | column 32
| octave:1>
| | I had to apply the attached fix | | Kai
| # HG changeset patch
| # User address@hidden
| # Date 1220704799 -7200
| # Node ID e6892ff5a9cf40285ed007e4d4cb6b2e4115fab9
| # Parent  46aa040553254660894f13bf131688ca8d384527
| Make contourf work for equal-size matrices (again).
| | diff -r 46aa04055325 -r e6892ff5a9cf scripts/ChangeLog
| --- a/scripts/ChangeLog       Wed Sep 03 11:40:55 2008 -0400
| +++ b/scripts/ChangeLog       Sat Sep 06 14:39:59 2008 +0200
| @@ -1,3 +1,8 @@
| +2008-03-14  Kai Habel  <address@hidden>
| +
| +        * plot/contourf.m: Fix case for equal-sized matrices
| +        of X and Y.
| +
|  2008-09-02  David Bateman  <address@hidden>
| | * plot/__add_datasource__.m: Fix indexing of varargin.
| diff -r 46aa04055325 -r e6892ff5a9cf scripts/plot/contourf.m
| --- a/scripts/plot/contourf.m Wed Sep 03 11:40:55 2008 -0400
| +++ b/scripts/plot/contourf.m Sat Sep 06 14:39:59 2008 +0200
| @@ -227,7 +227,7 @@
|      arg(1:4) = [];
|    endif
| | - if (!isvector (X) || !isvector (Y) && any (size (X) != size (Y)))
| +  if ((!isvector (X) || !isvector (Y)) && !size_equal(X,Y))
|      error ("patch: X and Y must be of same size")
|    endif

So many nots!  Maybe it would be clearer to write

  if (! ((isvector (X) && isvector (Y)) || size_equal (X, Y)))

?

jwe

O.k, bit I think both expression are not that easy to read. You
can use the attached changeset instead.

Kai


# HG changeset patch
# User address@hidden
# Date 1220709859 -7200
# Node ID c3833cb20abc41adf3f72fd0d2ed307ea1fdfa57
# Parent  46aa040553254660894f13bf131688ca8d384527
Make contourf work for equal-size matrices (again).

diff -r 46aa04055325 -r c3833cb20abc scripts/ChangeLog
--- a/scripts/ChangeLog Wed Sep 03 11:40:55 2008 -0400
+++ b/scripts/ChangeLog Sat Sep 06 16:04:19 2008 +0200
@@ -1,3 +1,8 @@
+2008-09-06  Kai Habel  <address@hidden>
+
+        * plot/contourf.m: Fix case for equal-sized matrices
+        of X and Y.
+
 2008-09-02  David Bateman  <address@hidden>
 
        * plot/__add_datasource__.m: Fix indexing of varargin.
diff -r 46aa04055325 -r c3833cb20abc scripts/plot/contourf.m
--- a/scripts/plot/contourf.m   Wed Sep 03 11:40:55 2008 -0400
+++ b/scripts/plot/contourf.m   Sat Sep 06 16:04:19 2008 +0200
@@ -227,7 +227,7 @@
     arg(1:4) = [];
   endif
 
-  if (!isvector (X) || !isvector (Y) && any (size (X) != size (Y)))
+  if (! ((isvector (X) && isvector (Y)) || size_equal (X, Y)))
     error ("patch: X and Y must be of same size")
   endif
 



reply via email to

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