[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57323] Matlab griddata includes both Octave's
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #57323] Matlab griddata includes both Octave's griddata and griddata3. Octave's related griddata errors also misleading |
Date: |
Thu, 28 Nov 2019 22:03:39 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36 |
URL:
<https://savannah.gnu.org/bugs/?57323>
Summary: Matlab griddata includes both Octave's griddata and
griddata3. Octave's related griddata errors also misleading
Project: GNU Octave
Submitted by: nrjank
Submitted on: Fri 29 Nov 2019 03:03:38 AM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Nicholas Jankowski
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 5.1.0
Operating System: Microsoft Windows
_______________________________________________________
Details:
while trying to run an example from the Matlab help, I got an odd error from
Octave.
here's the example:
xyz = -1 + 2*gallery('uniformdata',[5000 3],0);
x = xyz(:,1); y = xyz(:,2); z = xyz(:,3);
v = x.^2 + y.^2 + z.^2;
d = -0.8:0.05:0.8;
[xq,yq,zq] = meshgrid(d,d,0);
vq = griddata(x,y,z,v,xq,yq,zq);
surf(xq,yq,vq);
it should produce the image in the attached examplefig.png file.
The error received from octave running this same example was:
>> vq = griddata(x,y,z,v,xq,yq,zq);
error: griddata: XI and YI must be vectors or matrices of same size
error: called from
griddata at line 76 column 5
an interesting and unhelpful error because:
>> size(xq), size(yq)
ans =
33 33
ans =
33 33
I then noticed that Octave' griddata only takes:
ZI = griddata (X, Y, Z, XI, YI, METHOD)
and has a griddata3 function that takes:
VI = griddata3 (X, Y, Z, V, XI, YI, ZI, METHOD, OPTIONS)
according to the matlab help for griddata, it accepts optionally accepts the
inputs taken by griddata3, except it does not recognize 'options' to be passed
to the internal triangulation function.
seems compatibility could maybe be achieved by extending griddata with a
wrapper to call griddata three depending on input count/type. Without
stepping through it, I'm not sure what triggered the misleading error message
regarding xi yi sizes not matching.
(note that the example runs without error on Octave by changing the griddata
call to griddata3)
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 29 Nov 2019 03:03:38 AM UTC Name: examplefig.png Size: 69KiB By:
nrjank
<http://savannah.gnu.org/bugs/download.php?file_id=47943>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57323>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #57323] Matlab griddata includes both Octave's griddata and griddata3. Octave's related griddata errors also misleading,
Nicholas Jankowski <=