help-octave
[Top][All Lists]

## Re: interp1 - bug

 From: Roberto Abuter Subject: Re: interp1 - bug Date: Sat, 12 Sep 2009 13:41:37 +0200 User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)

```
I am sorry for the double posting, I am very new to this list.
```
Indeed, X is not monotonically increasing and I now see in the Octave function description that X has to be monotonic.
```Sorry for missing that !
I guess it is just a difference in behavior between Matlab and Octave.
one can always reshuffle (X,Y) in such a way X becames monotonic.

many thanks again,
Roberto AButer

John W. Eaton wrote:

```
```On 12-Sep-2009, Roberto Abuter wrote:

|    I am using the most basic form of interp1 in both matlab and octave.
```
| To my surprise interp1 in octave (3.0.2) is producing some very | strange results on my data. | | I have a set of two vectors X, Y where X has a sawtooth shape (4 | repetitions) and Y has 4 repetitions of an increasing/decreasing | amplitude sine wave.
```|    to start very simple I just check the interp1 engine by making :
```
| | XI = X;
```|    YI = interp1(X,Y,XI)
```
| | | to my surprise, the result YI comes out not identical to Y . | | well, if I try to interp1 with XI as my target grid ( a regular one | ) I get absolutely wierd results. | | hope someone can give me a hint.
```
Is X monotonically increasing (or decreasing)?  From your description
it sounds like it is not.

If you think you've found a bug, then please include enough
information so that someone can reproduce precisely what you are
doing and report it to address@hidden

In any case, there is no need to cross post to both the bug and help
lists.

jwe
```
```

```