On 12/6/2012 9:14 AM, Steven_Lord wrote:
...
> _Disordered_ values in x are not ambiguous. The interpolation functions
> may sort the data for efficiency if it's not sorted (I don't remember
> off the top of my head) but they should be okay handling the scrambled
> data.
I did look; at least in this release it does sort() the vector.
That makes it work for one definition of working...it isn't the same as
I was pointing out that if one has X=[0 3 2] and XI = 2.5 as presented
there are two possible results if look at the linear ranges as ordered.
interp1() treats the data internally as if the call were
interp1([x,ix]=sort(x),y(ix),XI)
where I've expanded syntax to be smart in picking the desired return
value in embedding the sort() call in the argument list.
That's fine and I'll try to remember the behavior but probably should be
pointed out in the doc's...
I was thinking for some reason that it was solved the other way 'round
by disallowing the disordered input--don't remember now why. Probably
because at some point I wanted a piecewise version in some app years ago
and fiddled around w/ it...
I see I have made a couple of patches on interp1 here but they have to
do w/ the size() returned in a case where the number of columns was more
than the number of rows and internally the function used length()
instead of size(1) and thus swapped rows for columns and ended up
interpolating on rows instead of columns.
This latter is related somewhat to the discussion we had recently on the
expanded syntax that was proposing to remove the vectorized calling
syntax because it had been "enhanced" to the point of excessive
complexity between this release and current such that it was deemed
desirable to remove some of that added functionality.
Anyways, the last is a sidebar for sure...still would like to see Matt's
actual data and why he's getting no joy.
--
--