If you are trying to save to a text file with column headers then really the best way is to fopen fprintf the headers fprintf the data and then fclose.
Save data matlab mat.
For example you can save data to a subset of a variable in a mat file or read a subset of a variable into the matlab workspace.
By default matlab compresses the data it saves to mat files.
Data compression is optional however and you can disable it either for an individual save operation or for all of your matlab sessions.
Name of file specified as a character vector or string scalar.
If filename has no extension that is no period followed by text and the value of format is not specified then matlab appends mat if filename does not include a full path matlab saves to the current folder.
Save and load workspace variables.
The workspace is not maintained across sessions of matlab when you quit matlab the workspace clears.
If you do not specify filename the save function saves to a file named matlab mat.
If you save data to a mat file that you intend to load using matlab version 6 or earlier.
However you can save any or all the variables in the current workspace to a mat file mat you can then reuse the workspace variables later during the current matlab session or during another session by loading the saved mat file.
Once you had created the table described there you can save it to a mat file.
Are you trying to create a text output file or a binary output file.
Matlab also uses unicode character encoding when saving character data.
Save data to a subset of a variable y in the file myfile2 mat using the mat file object.
Data compression can save you a significant amount of storage space when you are working with large files or working over a network.