[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65134] griddata function incompatibility with
From: |
Arnaud Delorme |
Subject: |
[Octave-bug-tracker] [bug #65134] griddata function incompatibility with MATLAB |
Date: |
Sun, 7 Jan 2024 14:31:42 -0500 (EST) |
URL:
<https://savannah.gnu.org/bugs/?65134>
Summary: griddata function incompatibility with MATLAB
Group: GNU Octave
Submitter: arnodelorme
Submitted: Sun 07 Jan 2024 07:31:41 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Arno
Originator Email:
Open/Closed: Open
Release: 8.4.0
Discussion Lock: Any
Operating System: Mac OS
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sun 07 Jan 2024 07:31:41 PM UTC By: Arnaud Delorme <arnodelorme>
Tested with MATLAB 2023b and Octave 8.4
Using this code
xi = linspace(1,10,100);
yi = linspace(1,10,100);
[Xi,Yi,Zi] = griddata(1:10,1:10,double(rand(10,10)),yi',xi,'v4');
The size of Xi is 100x100 on MATLAB but it is 100x1 on Octave.
On Octave to achieve the same result, one must use.
xi = linspace(1,10,100);
yi = linspace(1,10,100);
[xi,yi] = meshgrid(xi, yi);
[Xi,Yi,Zi] = griddata(1:10,1:10,double(rand(10,10)),yi,xi,'v4');
In the first call, because yi is transposed, the griddata function
automatically calls the meshrid function. In Octave, to do the trick, it might
be possible to add a check at the beginning of the griddata function such as:
if all(size(xi) == size(yi)') && any(size(xi) == 1)
[xi,yi] = meshgrid(xi, yi);
end
Right now, the Octave griddata performs a 1-D interpolation while MATLAB
performs of a 2-D interpolation.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65134>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #65134] griddata function incompatibility with MATLAB,
Arnaud Delorme <=
- [Octave-bug-tracker] [bug #65134] griddata function incompatibility with MATLAB, John W. Eaton, 2024/01/07
- [Octave-bug-tracker] [bug #65134] griddata function incompatibility with MATLAB, Nicholas Jankowski, 2024/01/08
- [Octave-bug-tracker] [bug #65134] griddata function incompatibility with MATLAB, Nicholas Jankowski, 2024/01/08
- [Octave-bug-tracker] [bug #65134] griddata function incompatibility with MATLAB, Rik, 2024/01/08
- [Octave-bug-tracker] [bug #65134] griddata row+col vector inputs do not implicitly expand to grid, Nicholas Jankowski, 2024/01/08
- [Octave-bug-tracker] [bug #65134] griddata row+col vector inputs do not implicitly expand to grid, Nicholas Jankowski, 2024/01/08
- [Octave-bug-tracker] [bug #65134] griddata row+col vector inputs do not implicitly expand to grid, Nicholas Jankowski, 2024/01/08
- [Octave-bug-tracker] [bug #65134] griddata col+row ordered query point inputs do not expand to grid (undocumented matlab), Nicholas Jankowski, 2024/01/08
- [Octave-bug-tracker] [bug #65134] griddata col+row ordered query point inputs do not expand to grid (undocumented matlab), Nicholas Jankowski, 2024/01/08
- [Octave-bug-tracker] [bug #65134] griddata: output size inconsistent for vector input interpolation points, Nicholas Jankowski, 2024/01/08