Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7384

Re: How to define a localized indexed object in Manipulate?

From "Nasser M. Abbasi" <nma@12000.org>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to define a localized indexed object in Manipulate?
Date 2011-12-21 11:58 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jcshkq$2a7$1@smc.vnet.net> (permalink)
References <201112180937.EAA01710@smc.vnet.net> <jcpftv$qim$1@smc.vnet.net>

Show all headers | View raw


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


Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: How to define a localized indexed object in Manipulate? Bob Hanlon <hanlonr357@gmail.com> - 2011-12-20 08:10 +0000
  Re: How to define a localized indexed object in Manipulate? "Nasser M. Abbasi" <nma@12000.org> - 2011-12-21 11:58 +0000

csiph-web