[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #38948] interp1 output has wrong order with 'n
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #38948] interp1 output has wrong order with 'nearest' |
Date: |
Thu, 09 May 2013 10:44:12 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 |
URL:
<http://savannah.gnu.org/bugs/?38948>
Summary: interp1 output has wrong order with 'nearest'
Project: GNU Octave
Submitted by: None
Submitted on: Thu 09 May 2013 10:44:10 AM UTC
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Assigned to: None
Originator Name: Michiel
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 3.6.2
Operating System: Microsoft Windows
_______________________________________________________
Details:
Hi,
I noticed strange behavior with interp1 in combination with 'nearest'.
x=[11:20']';
y=[1:10]';
interp1(x,y, x(2:end-1)+[0.5 -0.5], 'nearest')
ans =
3 7
2 6
4 8
3 7
5 9
4 8
6 10
5 9
Notice that the output is given in the first column instead of per row
I would expect:
ans =
3 2
4 3
5 4
6 5
7 6
8 7
9 8
10 9
my current workaround is:
interp1(x,y, x(2:end-1)+[0.5 -0.5], 'nearest')(:), 2,8)'
Cheers,
Michiel
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?38948>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #38948] interp1 output has wrong order with 'nearest',
anonymous <=