FindIfInBetween:

Path: Math/MathUtils

% Determines if x is in between odd-even pairs.
 a is a sequence [100 200 300 400 900 1200]

 k is 1 if x is between a pair j, j+1 where j is odd such as
 1 and 2 or 3 and 4.

 Type FindIfInBetween for a demo.

--------------------------------------------------------------------------
   Form:
   k = FindIfInBetween( x, a )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x       (1,1)   Value
   a       (1,2*n) Even length array

   -------
   Outputs
   -------
   k       (1,1)   1 if x is between indices j and j + 1 where j is odd

--------------------------------------------------------------------------

Back to the Math Module page