I have a 2D matrix myMatrix of integers which I want to save its content to a text file. I did the following:
myMatrix
save myFile.txt myMatrix -ASCII >
To write myMatrix to myFile.txt:
dlmwrite('myFile.txt', myMatrix);
To read the file into a new matrix:
newMatrix = dlmread('myFile.txt');