bugGNU Octave - Bugs: bug #45125, griddata matlab incompatibility

 
 

bug #45125: griddata matlab incompatibility

Submitted by:  José Luis García Pallero <jgpallero>
Submitted on:  Mon 18 May 2015 10:00:23 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 22 May 2015 02:41:01 AM UTC, comment #5:

I had someone verify that Matlab returns xi and yi if nargout == 2, so I updated the logic to return zi in the first output argument only when nargout is 0 or 1. Pushed to the default branch for 4.2:

http://hg.savannah.gnu.org/hgweb/octave/rev/561af1ab6099

Mike Miller <mtmiller>
Project Administrator
Thu 21 May 2015 03:51:20 AM UTC, comment #4:

I would leave in the nargout == 3 case. It seems perfectly legitimate and Matlab often tries to deprecate these things, but they persist for years because customers actually like them and push back. The cset otherwise seems good to me.

Rik <rik5>
Project Administrator
Thu 21 May 2015 12:40:01 AM UTC, comment #3:

I fixed this as in the attached diff (not yet pushed).

I am not sure what to do about deprecation of the nargout == 3 case or what to do if griddata is called with nargout == 2 for example (I'll get someone to check this for me if I get a chance).

(file #34068)

Mike Miller <mtmiller>
Project Administrator
Mon 18 May 2015 11:24:40 PM UTC, comment #2:

Yes, zi2 is a 5x1 column vector (tested in Matlab).

I see from the public documentation that the 3-output form of griddata is deprecated, btw.

Also worth noting that there is no zero-output form anymore, calling griddata with no output arguments just returns the interpolated values same as the 1-output form.

So if anything, the fix should just be to get rid of the nargout == 0 case altogether.

Mike Miller <mtmiller>
Project Administrator
Mon 18 May 2015 08:41:32 PM UTC, comment #1:

Could you try the following in Matlab?

What I find in Octave is that zi2 is a 1-D vector, not a 2-D matrix. When you try to call surf with

you get an error because zi2 needs to be a 2-D matrix (surface).

From the documentation, it seems that if xi and yi are vectors then the output should also be a vector of zi at the requested points. In that case, perhaps plot3() should be called instead of mesh() to plot individual points.

The code in griddata.m is

which could be modified to

Rik <rik5>
Project Administrator
Mon 18 May 2015 10:00:23 AM UTC, original submission:

If I try to use in Octave the griddata function as:

I obtain an error:

But in Matlab the function works and the output is a vector with the same dimensions as xi and yi

José Luis García Pallero <jgpallero>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #34068:  griddata.diff added by mtmiller (1KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jgpallero (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 22 May 2015 02:41:01 AM UTCmtmillerStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
      Release4.0.0-rc4=>dev
    Thu 21 May 2015 12:40:01 AM UTCmtmillerAttached File-=>Added griddata.diff, #34068
    Mon 18 May 2015 11:24:40 PM UTCmtmillerStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1