AnsweredAssumed Answered

Array change

Question asked by rsb on Mar 29, 2001
How about something that should work very fast---

try running your array through the formula

  dummy== NOT xcorrelate(a,[-1,1])-1;  //apply filter
  dummy[1,*]    //drop first element of the array

where "a" is your array.

The result should be an array of 1's and zero's where every 1
is an index such that the next element is one larger than the last.

"0" to "1" transitions are then the start array you are looking for
"1" to "0" transitions are the end array you are looking for.

If you use real values you may need to round them off before the
NOT to take care of 64-bit math issues

  dummy== NOT round(1000*(xcorrelate(a,[-1,1])-1))/1000;

You'll have to tweak this some but it may be a fairly decent way
of proceeding since it removes most looping methods.

Stan
---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo.  To send messages to
this maillist, just email to "vrf@lvld.agilent.com".  Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.agilent.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.agilent.com".
---------------------------------------------------------------------

Outcomes