07-31-2009 12:02 PM
I am trying to write a program that reads data stored in text files (CSV format) and plots these data; the user is allowed to pick how many plots/files they would like to see. Currently, when a new file is opened, the data read from it are appended to an existing array. However, this does not deal well with datasets of dissimilar length - if one set is shorter than another, the program will enter rows of zeros to match the length of the longer. I saw a possible solution here (an earlier post), but this assumes that my data are all in separate 1D arrays rather than the single 2D array I am using. Is there a way to dynamically write to an unspecified number of arrays (in a loop or something?) or a better solution?
Attached is my code along with two sample test text files.
Thanks!
08-03-2009 04:27 PM
I am confused about your code/data files. How does the data from the text file (and therefore the array) translate to the graph? The data in the first file is:
2,4,6 4,6,8 6,8,10 8,10,12 10,12,14
What do the columns and rows represent?