06-28-2011 04:08 AM
Please I would like to know how I can replace a number elements in an Array with zeros where the indexes of the elements to be replaced are built up in an array form too.
Solved! Go to Solution.
06-28-2011 04:28 AM
Use a for loop and replace one element per iteration (keep the data array in a shift register, auto-index the indices to replace).
06-28-2011 05:01 AM
Thanks,
It worked
06-28-2011 08:12 AM
Thanks, It worked but I am have an issue? the index I used was obtained from an array with elements repeating themselves in some cases. for example, the element at Index 0, say 4.75 occured about 20 times in the array so that when I tried getting out the indexes using search 1D array vi it indexed all 20 elements as index 0 (i.e. the index of the first occurence of the repeated elements). Please How do I avoid this?
06-28-2011 09:20 AM - edited 06-28-2011 09:28 AM
You can tell "search 1D array" to start the search at a specific index.
See topmost code in snippet.
If you only want to eliminate specific values you can also avoid the loop by comparing the value (see code in the middle).
But be careful when using search 1D array for floating point numbers. Probably in range & coerce should be used (see bottom code).