01-23-2014 10:10 AM
I get 'target' as the deleted portion fine. It's just that instead of it being deleted from the array I get an array where it is replaced by a second copy of the smallest member of 'used odors'.
01-23-2014 10:10 AM
The 'target' value must be identical to a value in the "used odors" array to be found by the "search 1D array" VI
01-23-2014 10:12 AM
@NeilR wrote:
They will be if the 'target' value cannot be found in the "used odors" array.
In that case an invalid value of -1 will be passed to "delete from array"
Interesting. I didn't expect a -1 to not "delete from array". It actually didn't put a smallest value in. It put a zero at the front. And the array isn't the same size, it is one element longer.
01-23-2014 10:17 AM
I just have an array of numbers for "used odors" > 3,4,5,6,7 and enter 77 as the target.
The "array w/ subset deleted" becomes 3,4,5,6,7 no deletion ... but no addition either ?
01-23-2014 10:18 AM - edited 01-23-2014 10:18 AM
If I understand what you want, you just want an array with the number equal to "target" removed? Am I correct in this understanding? If so, here are two ways to do it. I don't know if autoindexing does inplaceness in 2013, never bothered to benchmark again, but I think it was supposed to be optimized.
01-23-2014 10:21 AM
Simpler, put the Delete from Array in a case structure with the DFA in the true case. In the false, just wire the array through. Use a >=0 on the index from search from array to control the case structure.
And if your values are integers, stop using a double data type!
I still don't see how you get the results you say you are seeing.
ATTACH YOUR VI WITH DATA!
01-23-2014 10:28 AM
I still don't see how you get the results you say you are seeing.
Indeed. Bizarre !
01-23-2014 10:29 AM
I think this has the data.
Anyhow, odors used = [3 5 9 14 1].
Target = 5.
the array with deleted element is [1 3 9 14 1]
01-23-2014 10:31 AM
Your Index on the "used odor" control is set to 1 rather than 0 !!!!!!!!!!
This hides another value
01-23-2014 10:31 AM
Check your control. It is [1 3 5 9 14 1]. You just have the index set to show element 1 instead of element 0,
It works just fine. (But still make it integers instead of doubles.)