01-31-2013 01:43 PM
I have 2 1-d arrays of data going into a loop. Inside the loop, there is a formula node that combines the numbers from the 2 arrays and does some math to them. If the result of the calculation is 0, that means the value is invalid. Anything other than 0 is a good value. The result of the calculation comes out of the formula node, and leaves the loop becoming a 1-d array. Then my array gets saved to a spreadsheet. The 0's really screw up my graphs, and I would like to have them just be blanks instead. I tried using NaN's instead of 0's, but that also screws up my graphs. How can I put blanks into the output array instead of 0's?
Solved! Go to Solution.
01-31-2013 01:52 PM
It is better if you post your VI along with some typical data. It is hard to diagnose a problem from a written description of the VI.
It may be that you need a test for zero and then place the elements in the array only if the data is non-zero.
Lynn
01-31-2013 02:02 PM
Perhaps one way to do it would be to leave the zeros in the array and change the color to transparent if the value is zero?
I was able to modify the below example to only output 1/2 a sine doing this
01-31-2013 02:24 PM
Thanks for the reply. Here is the VI. This VI is called by another bigger program that gives it the input array and saves the output array to a spreadsheet. Right now it is putting in NaN's which mess up the graphs in excel when I look at the data later. The input array is just a big 2-d (1920x25)array in which all numbers are from 0-255. I would like to just have gaps in the data, like I said before. This way, I can see on my graph where the points are missing from. That's why I not just selectively adding to the array.
01-31-2013 02:44 PM
It seems that your real problem is defining what will make Excel leave gaps. For LV graphs NaNs do what you want.
You might also consider making the output array a string array. There may be string values (NUL?) which will cause Excel to skip.
Lynn
01-31-2013 03:28 PM
I think you are right. I was hoping there would be a better solution than converting it to strings to use NUL. Thanks.