Re: Recovering f[z] values?
- To: mathgroup at smc.vnet.net
- Subject: [mg42707] Re: [mg42692] Recovering f[z] values?
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Tue, 22 Jul 2003 04:40:42 -0400 (EDT)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <200307210915.FAA08637@smc.vnet.net>
- Reply-to: murray at math.umass.edu
- Sender: owner-wri-mathgroup at wolfram.com
If you are using version 5, a simple way to do this is with Reap and Sow. You'll need to restructure the list obtained as the second item in the resulting list so as to suit your purposes. Here's an example: f[z_] := z^2 Reap[Sow[z1 = 2]; Sow[f[z1]]; Sow[z2 = 3]; Sow[f[z2]]] {9, {{2, 4, 3, 9}}} AES/newspost wrote: > During the course of a long notebook evaluation a certain function > > f[z] = some function of z > > gets executed multiple times for various values of z which are no longer > remembered. Near the end of the calculation it's desired to recover all > these values, perhaps in a list > > {{z1,f[z1]}, {z2,f[z2}, . . . } > > Is there a simple way to do this? > > -- Reply to "REPLY TO" address and NOT to the "FROM" address!! Otherwise I will never see your reply!!!!!!!!!!!!!!!!!!!!!! Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
- References:
- Recovering f[z] values?
- From: AES/newspost <siegman@stanford.edu>
- Recovering f[z] values?