help-octave
[Top][All Lists]
Advanced

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

Re: [REQ] Lookup script


From: Jaroslav Hajek
Subject: Re: [REQ] Lookup script
Date: Tue, 27 Jan 2009 21:05:20 +0100

On Tue, Jan 27, 2009 at 6:00 PM, Nicola De Quattro
<address@hidden> wrote:
> Hi,
> I see on Octave Function Reference that no lookup .m script is present.
> Does anyone know how can I get it? I need to read it 'cause I don't
> understand how it works.
>
> Thank you
>
> Nicola De Quattro
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>

Here's a quote of the new lookup's help string:

 -- Function File: IDX = lookup (TABLE, Y, OPT)
     Lookup values in a sorted table.  Usually used as a prelude to
     interpolation.

     If table is strictly increasing and `idx = lookup (table, y)', then
     `table(idx(i)) <= y(i) < table(idx(i+1))' for all `y(i)' within
     the table.  If `y(i)' is before the table, then `idx(i)' is 0. If
     `y(i)' is after the table then `idx(i)' is `table(n)'.

     If the table is strictly decreasing, then the tests are reversed.
     There are no guarantees for tables which are non-monotonic or are
     not strictly monotonic.

     TABLE and Y can also be a cell array of strings (or Y can be a
     single string). In this case, string lookup is performed using
     lexicographical comparison.  If OPTS is specified, it shall be a
     string with letters indicating additional options.

     For numeric lookup, 'l' in OPTS indicates that the leftmost
     subinterval shall be extended to infinity (i.e. all indices at
     least 1), and 'r' indicates that the rightmost subinterval shall be
     extended to infinity (i.e. all indices at most n-1).

     For string lookup, 'i' indicates case-insensitive comparison.

I see that the wording is not very good is some places, but otherwise
I hope this description is understandable.

regards

-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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