I'm trying to write all of the data in a matrix into a file, and I have to have a header in this file so I'm using fprintf instead of dlmwrite or something like that.
I have a matrix A, and the format I want the file to be in is:
<header>
A(1,1) A(1,2) A(1,3)
A(2,1) A(2,2) A(2,3)
etc, etc.
After I write the header, I could put A in the file by using the command:
fprintf(file, '%g %g %g\n',A);
The problem is, A is actually 707 columns wide and 353 rows long, so it's impractical for me to write '%g' 707 times. How can I do this?
Thanks
I have a matrix A, and the format I want the file to be in is:
<header>
A(1,1) A(1,2) A(1,3)
A(2,1) A(2,2) A(2,3)
etc, etc.
After I write the header, I could put A in the file by using the command:
fprintf(file, '%g %g %g\n',A);
The problem is, A is actually 707 columns wide and 353 rows long, so it's impractical for me to write '%g' 707 times. How can I do this?
Thanks