MATLAB: Save to datafile

writing data to file

This is how they saved a matrix in my book:
I tried to save one myself but it did not work:
What did I do wrong?

Best Answer

There must be a sapce before '-ascii':
save twothree.dat mymat -ascii
This abbreviated form without parenthesis should be more convenient. In the full also called functional form, the command is:
save('twothree.dat', 'mymat', '-ascii')
Related Question