Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 332589 - [PATCH] The griddata function: griddata(x,y,z,xi,yi,method) won't work if xi and yi are vectors of the same size.
Summary: [PATCH] The griddata function: griddata(x,y,z,xi,yi,method) won't work if xi ...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL: http://octave.1599824.n4.nabble.com/g...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-13 11:37 UTC by pier
Modified: 2022-05-07 19:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch from http://octave.1599824.n4.nabble.com/griddata-fails-with-same-size-interpolation-vectors-td1673834.html (griddata_0.patch,1.66 KB, text/plain)
2010-08-13 11:39 UTC, pier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pier 2010-08-13 11:37:51 UTC
The griddata function: griddata(x,y,z,xi,yi,method) won't work if xi and
yi are vectors of the same size. 

Reproducible: Always

Steps to Reproduce:
Run the following script example:

#!/usr/bin/octave -qf

rand("state",1);
# Nf number of fine grid points
Nf=100;
# Nc number of coarse grid points
Nc=10;

# Domain
x0=-1;
y0=-1;
x1=1;
y1=1;

# 2*pi*f
R=1;

#3D fine grid graph x y z [100x1] vectors

x=(x1-x0)*rand(Nf,1)+x0;
y=(y1-y0)*rand(size(x))+y0;
z=cos(R*(x.^2+y.^2));

# build an intersection line along which extrapolate Nc coarse values

xi = linspace(x0,x1,Nc);
yi = linspace(y0,y1,Nc);

zi = griddata(x,y,z,xi,yi,"linear")
Actual Results:  
 ./prova_err.m   
error: product: nonconformant arguments (op1 is 7x1, op2 is 1x7)
error: called from:
error:   /usr/share/octave/3.2.4/m/geometry/griddata.m at line 113, column 11
error:   ./prova_err.m at line 25, column 4

Expected Results:  
./prova_err.m
zi =

       NaN   0.31105   0.80776   0.96378   0.99891   0.99656   0.96964   0.79186       NaN       NaN

./prova_err.m
zi =

       NaN   0.31105   0.80776   0.96378   0.99891   0.99656   0.96964   0.79186       NaN       NaN
Comment 2 Michael Orlitzky gentoo-dev 2022-05-07 19:52:48 UTC
This works correctly in newer versions of octave.