help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: griddata


From: Paul Kienzle
Subject: Re: griddata
Date: Mon, 10 Nov 2003 11:58:23 -0500
User-agent: Mutt/1.2.5.1i

There is a bug in octave introduced sometime between octave
2.1.40 and 2.1.48 where the wrong thing happens if the shape
of a boolean indexing matrix does not match the shape of the
matrix being indexed.

E.g.,

octave-2.1.40> x=[1,2;3,4]; x(:)'(x!=4)
ans =

  1  3  2

octave-2.1.48> x=[1,2;3,4]; x(:)'(x!=4)
ans =

  1  2
  3  5

It is still present in octave-2.1.50.

The following patch to griddata works around this problem.

I will post a new version shortly.

Paul Kienzle
address@hidden

diff -c -p -r1.5 griddata.m
*** griddata.m  27 Dec 2002 19:19:04 -0000      1.5
--- griddata.m  10 Nov 2003 16:46:32 -0000
*************** function [rx, ry, rz] = griddata (x,y,z,
*** 67,73 ****
  
      ## keep non zero values before overwriting zeros with 1
      valid=!isnan(reshape(tri_list,size(xi)));
!     tri_list = tri_list(valid);
      nr_t=rows(tri_list);
  
      ## assign x,y,z for each point of triangle
--- 67,73 ----
  
      ## keep non zero values before overwriting zeros with 1
      valid=!isnan(reshape(tri_list,size(xi)));
!     tri_list = tri_list(!isnan(tri_list));
      nr_t=rows(tri_list);
  
      ## assign x,y,z for each point of triangle

On Mon, Nov 10, 2003 at 12:36:17PM +0100, Claudio Belotti wrote:
> Hi all,
>    has anyone succeeded in using griddata from octave.sourceforge.net?
> 
> Claudio
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
> 
> 
> 



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]