bugGNU Octave - Bugs: bug #30002, size error in contourf()

 
 

bug #30002: size error in contourf()

Submitted by:  Petr Mikulik <mikulik>
Submitted on:  Mon 31 May 2010 08:23:55 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 01 Jun 2010 04:21:22 PM UTC, comment #4:

Fixed in changeset 10675:e5b1353695ef. Thanks for noticing this. Apparently it is pretty common to use equal x and y ranges so the difference between columns and rows was not apparent.

Rik <rik5>
Project Administrator
Tue 01 Jun 2010 06:53:47 AM UTC, comment #3:

Hmm, let's try again ... it seems that this comment boxes eats stars:
<pre>
z = xx.xx + yy.yy;
</pre>

or

z = xx .STAR xx + yy .STAR yy;

Petr Mikulik <mikulik>
Tue 01 Jun 2010 06:52:10 AM UTC, comment #2:

Hm, stars were lost:

z = xx.xx + yy.yy;

Petr Mikulik <mikulik>
Mon 31 May 2010 09:45:48 PM UTC, comment #1:

Could you verify that the code you posted is EXACTLY what you ran in Octave? Octave fails for me at line 3 before reaching the call to contourf.

x=1:10; y=1:20;
[xx,yy]=meshgrid(x,y);
z=xx.xx+yy.yy;
error: matrix cannot be indexed with .

Rik <rik5>
Project Administrator
Mon 31 May 2010 08:23:55 AM UTC, original submission:

The following code using contourf() fails in _contour_.m:
x=1:10; y=1:20;
[xx,yy]=meshgrid(x,y);
z=xx.xx+yy.yy;
contourf(z);

It works correctly with
contourf(x,y,z);

I propose the following fix:

--- _contour_-orig.m 2010-05-31 09:46:26.000000000 +0200
+++ _contour_.m 2010-05-31 10:22:34.000000000 +0200
@@ -81,8 +81,8 @@

if (length(varargin) < 5)
z1 = varargin{3};
- x1 = 1 : rows(z1);
- y1 = 1 : columns(z1);
+ x1 = 1 : columns(z1);
+ y1 = 1 : rows(z1);
else
x1 = varargin{3};
y1 = varargin{4};

Petr Mikulik <mikulik>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mikulik (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 01 Jun 2010 04:21:22 PM UTCrik5StatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Mon 31 May 2010 09:45:48 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1