Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Petra
Posts:
4
Registered:
12/3/12


lookup table
Posted:
Dec 6, 2012 2:32 AM


Hi all, I need to find the fastest way to compare to vectors. here is a little example: % I got 2 vectors a=[1 2.4 3.1 4.9 5.7] b=[1.2 5.9 4.7 2.3 9.5 6 4.8] % b is a very long vector every number in b should search in a for the next lesser number. The answer should be like this: [1 5.7 3.1 1 5.7 5.7 3.1]
Is there a fast way. Maybe without a loop. Thank you



