I am working with Matlab code that writes coordinates to a text file as follows:
838959.41800,4713239.59000,1.00000,841305.41800,4708452.59000,1.00000,839175.41800,4712582.59000,1.00000
In the past, I’ve had to open each file individually and add the following to the first line of the .txt document:
x,y,z,
838959.41800,4713239.59000,1.00000,841305.41800,4708452.59000,1.00000,839175.41800,4712582.59000,1.00000
Any ideas on how to automate this process by embedding code which will write “x,y,z,” to the first line of the Matlab output?
Thanks much,
-Aaron
Here is an example:
The output file:
data.txt