05-13-2015 10:12 AM - edited 05-13-2015 10:15 AM
I have 2 column data represent amplitude and time. My ideas is to read the data from text file and plot it to waveform graph. I have a problem where i cannot plot the whole data to the graph.
Can someone check my code.
Thank you in advance.
05-13-2015 12:01 PM
05-13-2015 01:13 PM
Not everyone who reads the Forum is on LAVA, so I'll answer here.
Your data are not a Waveform (which has only a Y array, with the time element implicitly represented by t0 and dt). You, instead, have time (X) explicitly represented, so you want to plot X vs Y, and hence want an XY Graph.
Now you'll see another (minor) problem -- Plot Graph wants a cluster consisting of the array of X points and the array of Y points. The spreadsheet has X as the first column. If you use Index Array to pull out the columns, you'll need to wire 0 and 1 to the column inputs. If you don't wire anything into the index inputs of Index Array, it will return the first row, not column. If you want to use the feature of "pulling down" a second output and want to export rows, simply take the transpose of the 2D array from Read from Spreadsheet.
Bob Schor
05-13-2015 04:04 PM
05-13-2015 10:24 PM
Read from Spreadsheet File has an input called Transpose. It defaults to False. Wire a true constant to that and the 2-D array comes out already transposed.