Learn more about simulink external mode.
Save data in matlab mat.
If you save data to a mat file that you intend to load using matlab version 6 or earlier then you must specify the v6 option when saving.
Are you trying to create a text output file or a binary output file.
Access specific parts of a variable in a mat file using the mat file object.
Select matlab general mat files and then choose a mat file save format option.
Specify the v6 option if you want to disable both of these features for a particular save operation.
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.
To save variables to a matlab script click the save workspace button or select the save as option and in the save as window set the save as type option to matlab script.
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.
How can i save mat data from twincat.
Once you had created the table described there you can save it to a mat file.