Re: How to define a localized indexed object in Manipulate?
- To: mathgroup at smc.vnet.net
- Subject: [mg123827] Re: How to define a localized indexed object in Manipulate?
- From: "Nasser M. Abbasi" <nma at 12000.org>
- Date: Wed, 21 Dec 2011 06:56:01 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201112180937.EAA01710@smc.vnet.net> <jcpftv$qim$1@smc.vnet.net>
- Reply-to: nma at 12000.org
On 12/20/2011 2:10 AM, Bob Hanlon wrote:
> I forgot that you wanted p localized. You can use Module to keep p out
> of the global context.
>
> Clear[p]
>
> Module[{p},
> Manipulate[
> p@n = n;
> StringForm["p@`1` = `1`; Sum = `2`", n, Sum[p[k], {k, n}]],
> Button["Click to update p@n", n++],
> {{n, 0}, None}]]
>
> ?? p
>
>
Thanks Bob, But sorry I forgot to mention that this
is for a demonstration Manipulate type. Hence, one is
not allowed to have a Module outside Maniuplate. (One
of the rules for writing demonstration is that Manipulate
must be the first thing).
--Nasser
- References:
- How to define a localized indexed object in Manipulate?
- From: "Nasser M. Abbasi" <nma@12000.org>
- How to define a localized indexed object in Manipulate?