bugGNU Octave - Bugs: bug #39370, contourc adds duplicates to the...


bug #39370: contourc adds duplicates to the start and end of the 1st level

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Sun 30 Jun 2013 09:30:19 AM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Ben Abbott Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


Mon 21 Nov 2016 10:09:13 PM UTC, comment #5: 

This issue is still present in Octave 4.2.0.

Hartmut <hardy>
Wed 31 Dec 2014 06:02:02 AM UTC, comment #4: 

At first this looks bad, but I think this is mostly a performance hit.  The duplicate points shouldn't affect the drawing of the contour, although I can't guarantee that.

I took a look at _contour_.cc and the code is very old and I couldn't figure out what was going on easily.

Rik <rik5>
Project Administrator
Sat 06 Jul 2013 03:45:58 PM UTC, comment #3: 

Ok. It is a bug in _contourc_.cc

The first level list has duplicates for the beginning and end.

x = [1 1 2 2];
y = [2 2 1 1];

is the same as;

x = [1 2];
y = [2 1];

Ben Abbott <bpabbott>
Project Member
Sat 06 Jul 2013 03:08:53 PM UTC, comment #2: 

To be honest, I'm not sure if this is a bug or a documentation error.  I'll try to find the time to dig deeper in the next few days.

Ben Abbott <bpabbott>
Project Member
Wed 03 Jul 2013 03:56:05 PM UTC, comment #1: 

Is the documentation on the example incorrect or is the contourc code incorrect?  It seems like Octave has been generating a 2x8 matrix for the example since at least version 3.2.4.  Meanwhile, Matlab and the documentation suggest a 2x6 matrix is correct.

Maybe we should re-title the report.

Rik <rik5>
Project Administrator
Sun 30 Jun 2013 09:30:19 AM UTC, original submission:  

"help contourc" displays the example below.

          x = 0:2;
          y = x;
          z = x' * y;
          contourc (x, y, z, 2:3)
             =>   2.0000   2.0000   1.0000   3.0000   1.5000   2.0000
                  2.0000   1.0000   2.0000   2.0000   2.0000   1.5000

The sources produce this result.

a = contourc (x, y, z, 2:3)
a =

   2.0000   1.0000   1.0000   2.0000   2.0000   3.0000   1.5000   2.0000
   4.0000   2.0000   2.0000   1.0000   1.0000   2.0000   2.0000   1.5000

Matlab doesn't match either result.

ans =

    2.0000    1.0000    2.0000    3.0000    1.5000    2.0000
    2.0000    2.0000    1.0000    2.0000    2.0000    1.5000

Ben Abbott <bpabbott>
Project Member


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by bpabbott (Submitted the item)

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

    Only project members can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-12-31 rik5 StatusNone => Confirmed
    2013-10-29 mtmiller CategoryDocumentation => Octave Function
        Item GroupDocumentation => Matlab Compatibility
    2013-07-06 bpabbott Summarycontourc example is incorrect => contourc adds duplicates to the start and end of the 1st level

    Back to the top

    Powered by Savane 3.5