A few weeks ago I created a big matrix, and in order not to have to recreate it, I stored it using DumpSave["file.mx", variable]. Now I want to read it back in and so I use <variable I used in when I saved it. My generating command is unfortunately not around any more. Is there any way of figuring out what my variable was called or more directly, how to access my data now that it is loaded?
Answer
I think you can use Names["Global`*"] to get the name:
a = RandomReal[{0, 1}, 10];
SetDirectory[$TemporaryDirectory];
DumpSave["1.mx", a];
Quit[]
SetDirectory[$TemporaryDirectory];
<< 1.mx
Names["Global`*"]
(*{"a"}*)
Comments
Post a Comment