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


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

How to define a localized indexed object in Manipulate?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!novia!newsfeeds.sol.net!post2.nntp.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
From "Nasser M. Abbasi" <nma@12000.org>
Newsgroups comp.soft-sys.math.mathematica
Subject How to define a localized indexed object in Manipulate?
Date Sun, 18 Dec 2011 09:40:03 +0000 (UTC)
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <jckcdj$1mc$1@smc.vnet.net> (permalink)
Reply-To nma@12000.org
Lines 55
NNTP-Posting-Date 18 Dec 2011 08:44:50 GMT
NNTP-Posting-Host ce2d724c.news.twtelecom.net
X-Trace DXC=eEM4cQTiVNZG[n\L2_@9VQC_A=>8kQj6]=_1NR_H?JP]QiTj_dIj_1VEFiONJ7[GoV56HfJ_WdaTX
X-Complaints-To abuse@twtelecom.net
Xref x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:7331

Show key headers only | View raw


Hello,

Any one knows how to define and use an indexed object in Manipulate?

Looking at the example below, p@x is an indexed object used by
Manipulate.

--------------------------------
Manipulate[
   p@x=p@x+1;
   n;
   Row[{"p@x=",p@x}],

   Button["click to update p@x",n++],
   {{n,0},None},
   TrackedSymbols:>{n},

   Initialization:>
   {
     p@x=0
   }
]
--------------------------------

But in the above, I had to put p@x in the  Initialization section
because I did not know how to make a Manipulate Dynamic. This
makes p@x become global, and will not be localized when one makes
a new copy of the Manipulate snapshot, causing a problem.

The obvious solution, which is to add

{{p@x,0},None}

to make p@x become a Manipulate own Dynamic, does not work for
indexed object. So, I could not do the following:

--------------------------------
Manipulate[
   p@x=p@x+1;
   n;
   Row[{"p@x=",p@x}],

   Button["click to update p@x",n++],
   {{n,0},None},
   {{p@x,0},None},    (* DOES NOT WORK, what is the synatx to use?*)
   TrackedSymbols:>{n}
]
--------------------------------

Any tick or hint how to do this will be great.

Thank you,
--Nasser

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


Thread

How to define a localized indexed object in Manipulate? "Nasser M. Abbasi" <nma@12000.org> - 2011-12-18 09:40 +0000
  Re: How to define a localized indexed object in Manipulate? Armand Tamzarian <mike.honeychurch@gmail.com> - 2011-12-19 12:15 +0000
    Re: How to define a localized indexed object in Manipulate? "Nasser M. Abbasi" <nma@12000.org> - 2011-12-21 11:53 +0000

csiph-web