04-24-2012 05:37 PM
Hi!
I want to write a matrix to an ascii file in the following way, first a given head line, then n measurements:
151718..etc..
x10x20x30........
x11x21x31........
..............
..............
x1nx2nx2n........
Which is the easiest and most efficient way of reading and writing this to an ascii file?
Sorry if this already answered, thx for any help anyway!
BR!
Solved! Go to Solution.
04-24-2012 06:18 PM
Are you actually dealing with a matrix? Or are you using an array? Even if it is a matrix, you shold be able to convert it to a 2-D array.
Then you can use Write to Spreadsheet File to write the 2-D array to a file. Use whatever delimiter you like (is it "n" or "x" in your example?) at the top connector of the Write to Spreadsheet File VI to separate the elements within a given row. The rows will be separated by a linefeed character.
04-24-2012 06:58 PM
Sorry, I see my example came out wrong. I meant:
15('C) 17('C) 19('C) ...........
x1 y2 z3 ........
x2 y3 z3 ......... and so on where x, z and y are the measurments for each degree.
So if I format it into 2d-array where:
1.array -> 15('C) x1 x2 x3 .......
2.array -> 17('C) y1 y2 y3 .......
Then if I use a "write to spreadsheet file", what do i write in the format string?
04-24-2012 11:43 PM
Whatever format you want the data values to be. For instant, with 2 decimal places, %.2f.
04-25-2012 04:12 PM
Thx!