01-18-2021 10:51 AM
From a text spreadsheet of possible switch positions where options "on", "off", "either" exist with the values "0", "1", "2". I need to edit the resulting array to replace all the "2" values to be either "0" or "1". With the attached Array Testing.vi I am able to extract the spreadsheet into an array and then extract the indices of all the "2" values. I also generate an array of "0" and "1" to use for the edit.
I am having trouble understanding how to over-write the "2" values with the "0" or "1" from the randomly generated array while retaining the original array "0" and "1" data.
The final array of 0's and 1's will be converted to a boolean array.
What say you?
Solved! Go to Solution.
01-18-2021 11:45 AM
andy.mcleod@unh.edu wrote:
I am having trouble understanding how to over-write the "2" values with the "0" or "1" from the randomly generated array while retaining the original array "0" and "1" data.
Use a Select function. If the value is 2, use the new value. If not, use the old value.
01-18-2021 12:13 PM
Simple and easy to implement. Thank you!