MATLAB: How to save a matrix in workspace to may desktop with command.

my desktopsave

Hello, I would like to know how to save a matrix in workspace to may desktop with command. I want use the command in my program. For exsample, if there is a matrix a=[1 2 3;4 5 6];How to save it to my PC desktop with command?

Best Answer

You can use "save" and give it the path name to your desktop directory (if you do not happen to be there already.) For example,
save c:\documents and settings\tomoyuki\desktop\TestMatrix.mat a
or
save('c:\documents and settings\tomoyuki\desktop\TestMatrix.mat', 'a')
Related Question