I'm in need of some help regarding the best practice to initialize a new empty 2D array for a shift register inside a while loop.
I'm trying to record data from 2 inputs (I've replaced these with RNGs for the sake of simplicity) along with an elapsed time. The data is then recorded and saved to csv after a button is pressed to begin a new trial. The problem I'm running into is that if I don't empty out the array, I just end up recording all the previous trials (obviously this would defeat the whole purpose of dynamically naming the csv files if the last one will just contain all of the data from all the trials). What are some good ways of solving this?
Thanks in advance folks!
Some more generic comments to your coding style:
Thank you for your help, particularly with the format string trick which has made my life much easier, esp. since I'm new to labview
One last question: Is there a method to get headers into the csv?
Thanks in advance!
- You can add all strings to the format code to generate the file name. No need for all that string gymnastics. (Format would be "Trial%03.0f.csv")
Since its an integer, more correct would be "Trial%03d.csv", of course. The result would be the same.