I have matrix files that I would like to save as xls or txt files. Is there anyone who knows how to do?
1 Answer
0
Let's say that you have some data in a file called my_variable.fmt and you want to save it if a file named my_xls_file.xls. You can accomplish that like this:
//load the matrix from the .fmt file load my_variable; //write it to an Excel file xlsWrite(my_variable, "my_xls_file", "A1", 1, "");
More explanation of how to read and write Excel files in GAUSS can be found here.
To write the data to a .txt file you use the output function and the print function like this:
//load the matrix from the .fmt file load my_variable; //set output to print to 'my_txt_file.txt' //(reset means if the file exists write over it) output file=output.txt reset; //print 'my_variable' sending output to //the screen and 'my_txt_file.txt' print my_variable; //turn output to file off so no more //print statements go to this file output off;
Your Answer
1 Answer
Let's say that you have some data in a file called my_variable.fmt and you want to save it if a file named my_xls_file.xls. You can accomplish that like this:
//load the matrix from the .fmt file load my_variable; //write it to an Excel file xlsWrite(my_variable, "my_xls_file", "A1", 1, "");
More explanation of how to read and write Excel files in GAUSS can be found here.
To write the data to a .txt file you use the output function and the print function like this:
//load the matrix from the .fmt file load my_variable; //set output to print to 'my_txt_file.txt' //(reset means if the file exists write over it) output file=output.txt reset; //print 'my_variable' sending output to //the screen and 'my_txt_file.txt' print my_variable; //turn output to file off so no more //print statements go to this file output off;