# vrf convert real to string - engineering format

Question asked by VRFuser on Sep 16, 2002
> Hi folks,
>
> Since we appear to be thinking about arrays, perhaps someone can suggest
> a solution to another of my many problems.  I have a large 2D array of
> X, Y data which contains "bad" Y values.  I also have an array of X
> values for the "bad" Y values.  The values in both arrays are ordered in
> the same manner (hopefully the second array has fewer values however).
> Can anyone think of an efficient way to remove the "bad" values from the
> first array?
>
> 1st array = [[45, 76][50, 102][55, 23][60, 5][65, 43]]
> 2nd array = [50,60]
> results in [45,76][55,23][65,43]
>
> Barrie
> whoi

Hi Barrie,

Just a couple thoughts off the cuff.  It depends a lot on the nature
of your data and sizing to declare a solution good.  I'm going to
assume that your complete array is large enough to make itteration
infeasible.

If the "bad Y" array is small enough, so that you can itterate through
it, there are a couple things I can think of.
If order of the complete array is not important, you can create an
array of zeros with very large or very small values at the positions
corresponding the the bad positions in the whole array, then sort the
bad values to 1 end and chop them off.
Or if the order is important, build a formula up and feed it into a
formula box to build an array.  (off the top of my head) Something
like concat(a[0,*],concat(a[2,*],a[4,*]))
Or itterate through the list of bad values, and chop off the front to
the bad value and spit out the array fragments, collect them and
rebuild an array of good values.

If you have a "lot" of bad values, this may be a spot where you want
to write a small function in C to do the processing.  It is a simple
matter to take in arrays, manipulate the values and return them.  You
just need to also return a length and chop off the array that is
returned.

lBill

---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@it.lists.it.agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".