Re: Dynamic FindFit???????
- To: mathgroup at smc.vnet.net
- Subject: [mg91348] Re: Dynamic FindFit???????
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sun, 17 Aug 2008 06:39:10 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <g86855$hs6$1@smc.vnet.net>
..~ J u L i O ~.. ..~ L. A.~.. wrote:
> I'm Julio and I'm new with mathematica and I have a problem. I want to
> create a Dynamic FindFit without using Manipulate, just using Dynamic,
> but I'm not sure if it is possible. If you can help me it will be great.
I am not sure whether this is what you are looking for, but have you try
to wrap FindFit[] within Dynamic[]?
In[1]:= data = Table[Prime[x], {x, 20}]
Out[1]= {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, \
59, 61, 67, 71}
In[2]:= Dynamic[FindFit[data, a Exp[-k t], {a, k}, t]]
Out[2]= {a->8.17859,k->-0.112575}
(* Note that upon evaluation of In[3], Out[2] automatically updates to
the following *)
Out[2]= {a->72.2284,k->-0.0431004}
In[3]:= data = Table[Prime[x], {x, 20, 40}]
Out[3]= {71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, \
137, 139, 149, 151, 157, 163, 167, 173}
Regards,
-- Jean-Marc