Skip to main content
deleted 5 characters in body; edited tags; edited title
Source Link
rm -rf
  • 89.8k
  • 21
  • 303
  • 498

Save interpolated How do I save a variable or function definition to a file?

Is it possible to save a function which was created via Interpolation of some data in such a way that I can use this function in a new mathematicaMathematica session without repeated interpolation of the data?

For example, I have some data which I interpolate in the following way:

exampleData={{1,1},{2,3},{3,4},{4,7},{5,5},{6,4},{7,2}}; interPolFunc[x_]:=Interpolation[exampleData,x] 

Now one of the following would be nice: Either: There is a way to save the interpolated function so that it can be used the next time when I work with mathematica (but I do not want to interpolate the data again, so that I can delete them). Or: The data and Interpolation command are saved in a separated notebook which is executed when I want to use my interPolFunc in another notebook.

  • a way to save the interpolated function so that it can be used the next time when I work with Mathematica (but I do not want to interpolate the data again, so that I can delete them).
  • the data and Interpolation command are saved in a separated notebook which is executed when I want to use my interPolFunc in another notebook.

Unfortunately I did not find any solution for that. But I hope that some of you have several suggestions!

Save interpolated function

Is it possible to save a function which was created via Interpolation of some data in such a way that I can use this function in a new mathematica session without repeated interpolation of the data?

For example, I have some data which I interpolate in the following way:

exampleData={{1,1},{2,3},{3,4},{4,7},{5,5},{6,4},{7,2}}; interPolFunc[x_]:=Interpolation[exampleData,x] 

Now one of the following would be nice: Either: There is a way to save the interpolated function so that it can be used the next time when I work with mathematica (but I do not want to interpolate the data again, so that I can delete them). Or: The data and Interpolation command are saved in a separated notebook which is executed when I want to use my interPolFunc in another notebook.

Unfortunately I did not find any solution for that. But I hope that some of you have several suggestions!

How do I save a variable or function definition to a file?

Is it possible to save a function which was created via Interpolation of some data in such a way that I can use this function in a new Mathematica session without repeated interpolation of the data?

For example, I have some data which I interpolate in the following way:

exampleData={{1,1},{2,3},{3,4},{4,7},{5,5},{6,4},{7,2}}; interPolFunc[x_]:=Interpolation[exampleData,x] 

Now one of the following would be nice:

  • a way to save the interpolated function so that it can be used the next time when I work with Mathematica (but I do not want to interpolate the data again, so that I can delete them).
  • the data and Interpolation command are saved in a separated notebook which is executed when I want to use my interPolFunc in another notebook.

Unfortunately I did not find any solution for that. But I hope that some of you have several suggestions!

Tweeted twitter.com/#!/StackMma/status/170885525908111360
edited tags
Link
Szabolcs
  • 238.9k
  • 32
  • 653
  • 1.3k
Source Link
partial81
  • 3.1k
  • 1
  • 24
  • 30

Save interpolated function

Is it possible to save a function which was created via Interpolation of some data in such a way that I can use this function in a new mathematica session without repeated interpolation of the data?

For example, I have some data which I interpolate in the following way:

exampleData={{1,1},{2,3},{3,4},{4,7},{5,5},{6,4},{7,2}}; interPolFunc[x_]:=Interpolation[exampleData,x] 

Now one of the following would be nice: Either: There is a way to save the interpolated function so that it can be used the next time when I work with mathematica (but I do not want to interpolate the data again, so that I can delete them). Or: The data and Interpolation command are saved in a separated notebook which is executed when I want to use my interPolFunc in another notebook.

Unfortunately I did not find any solution for that. But I hope that some of you have several suggestions!