Here's a quick way. I don't know if it is the fastest possible, but it works well.
>From your original array A, compare it to the threshold T to get boolean array B: B = A > T Use a loop with a shift register to compare each value of B with its previous value. When it changes from F to T, you have found a crossing point. Output the loop index and whatever other info you need. Bruce ------------------------------------------ Bruce Ammons Ammons Engineering www.ammonsengineering.com (810) 687-4288 Phone (810) 687-6202 Fax -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick Allen Sent: Tuesday, January 20, 2004 2:12 PM To: '[EMAIL PROTECTED]' Subject: Caputring points on a threshold Salutations, On behalf of a co-worker: Analyzing an array of 600 acquired points over 3 milli-seconds post-process; we would like to capture the values that cross a set (Y) threshold and then save them to a separate array along with their (X) value. (Y) representing the value of the threshold and (X) representing the "point" (0-600) that hit the threshold. Any suggestions greatly appreciated. Thanks. -- Patrick Allen SciMech Technical Services Inc. Tel: (905) 693-0866 Fax: (905) 693-0867 Email: [EMAIL PROTECTED]
