Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Saving Interpolated Function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg81015] Re: Saving Interpolated Function
  • From: sashap <pavlyk at gmail.com>
  • Date: Sat, 8 Sep 2007 03:47:30 -0400 (EDT)
  • References: <fbqpja$696$1@smc.vnet.net>

Hi Phil,

You need to use Import/Export.

Using v 6:

(* construct an interpolating function *)
In[1]:= if =
  y /. NDSolve[ {y''[t] - y[t] t^2 == 0, y[0] == 0, y'[0] == 1},
     y, {t, 0, 10}][[1]];

In[2]:= Head[if]

Out[2]= InterpolatingFunction

In[3]:= Export[
 ToFileName[{$HomeDirectory, "Desktop"}, "interfunc.m"], if]

Out[3]= C:\Documents and Settings\....\Desktop\interfunc.m

In[4]:= if2 =
  Import[ToFileName[{$HomeDirectory, "Desktop"}, "interfunc.m"]];

In[5]:= if2 === if

Out[5]= True

Oleksandr Pavlyk
Wolfram Research

On Sep 7, 1:03 am, "lede... at ssb.rochester.edu"
<lede... at ssb.rochester.edu> wrote:
> I am doing some numerical analysis leading to an interpolated function
> that I will need later.
>
> These calculations take many minutes, and I want to beable to save the
> interpolated function--so it does not have to be regenerated every
> time I come back to the problem.
>
> How can I do this.?
>
> Thanks
>
> Phil




  • Prev by Date: Re: [Mathematica 6.0.1] Confusing documentation on ColorData, where
  • Next by Date: Re: private routines in mathematica 6 packages?
  • Previous by thread: Re: Saving Interpolated Function
  • Next by thread: Re: Saving Interpolated Function