0
$\begingroup$

Consider I have this code :

f[1]=2
f[1.5]=6
f[3]=4

What is the simplest way to save the array f defined on those three numbers in a file ? (in my case, I will have a lot of values, not juste three but the indices of my array will be regularly spaced).

How can I tell in a simple way to mathematica I want to save the full array f ? Am I forced to somehow loop on the indices ?

$\endgroup$
2
$\begingroup$

Both Save[filename,f] and DumpSave[filename,f] will do. You can read the definitions back with Get[filename].

$\endgroup$
  • $\begingroup$ the __f is to specify I am talking about the full array f and not the variable f ? $\endgroup$ – StarBucK Jun 23 at 17:25
  • 2
    $\begingroup$ It only looks like there are underscores because I've made hyperlinks. Just Save[filename,f]. By the way, f is not an array. $\endgroup$ – Roman Jun 23 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.