# Alternative to Dump Save

When dealing with large matrices I like to store them in the memory once for all, such that when I restart Mathematica I do not have to wait for a very long computational time of order of minutes.

To provide a simple example, my current solution is a "DumpSave"-ing local objects, e.g.

A=Table[i+j,{i,1,4},{j,1,4}];
DumpSave[LocalObject["A"],A];
Get[LocalObject[A]];


This saves the object persistently in the folder: ~/../.Wolfram/Objects.

However I do not quite like this, as I may overwrite some of the file by mistake and when switching from a PC to another I have to calculate the matrix again.

Ideally I would create another auxiliary notebook containing the full expression of the large matrix and just load it along with the main notebook, but most of time sis not possible to do that, as Mathematica is not able to fully expand such matrices.

Would you suggest a suitable alternative?

Thanks

• What about using the Export function? – Aaron Stevens Jul 27 '17 at 21:12
• Why not DumpSave to a directory of your own choosing and a file name of you own choosing by using a full path name for the file instead of making it a local object? – m_goldberg Jul 27 '17 at 22:29

file = "data.mat";

This writes the matrix to the file "data.mat" in the user's home directory. Of course, the value of file can be changed to any valid filename on your machine.