Re: Calculate the first time, not each time (?)
- To: mathgroup at smc.vnet.net
- Subject: [mg94584] Re: Calculate the first time, not each time (?)
- From: dh <dh at metrohm.com>
- Date: Tue, 16 Dec 2008 06:05:55 -0500 (EST)
- References: <gi7ljg$cui$1@smc.vnet.net>
Hi Michael, please read in the manual about Set and SetDelayed. If you use "=" instead of ":=" your problem is solved. Daniel Michael Young wrote: > Hello, > > > > > I'm doing some engineering which will involve a large number of points > -- and I anticipate time problems if all steps are repeated for each > one. Here's an outline of the way I'd like to approach it. > > > > shapeprimativeXvalues := N[Table[functionpX[v], {v, vlimit}]] > shapeprimativeYvalues := N[Table[functionpY[v], {v, vlimit}]] > > > > Arriving at these will involve some calculation, and once the results > are in, it is unnecessary that the this be repeated when the values > are used. > > > > adaptshapetoitslocation[v_] := (various operations on or including) > shapeprimativeXvalues[[v]] (and or) shapeprimativeYvalues[[v]] > > > > Is there a way I can instruct Mathematica to evaluate a table, (value > or function), once, when it is first called; then not to evaluate it > again, but to pass numerical results on request? > > >