On Thu, 21 Nov 2013, Artur T. wrote:
I am looking for a simple way to determine the column for which
scalar B
is, let's say, larger or equal to the entry A[i] and store this
information in scalar C. If B is never greater than any entry in A[i], C
is zero.
You say "the" column: does that mean A is a row vector and at most one
element of A is <= B? If so:
scalar i = iminr(A)
scalar C = A[i] <= B ? i : 0
If more than one element of A can satisfy the condition and you want the
index of the first such element:
scalar i = imaxr(A .<= B)
scalar C = A[i] <= B ? i : 0
Allin Cottrell