MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to define a localized indexed object in

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123803] Re: How to define a localized indexed object in
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Tue, 20 Dec 2011 03:02:37 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201112180937.EAA01710@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

OK... never heard of "indexed objects", if Help says that, fine.

That tells you nothing about what the object IS, however... it's just  
notation. A function applied to an argument can yield a number, string,  
list, or anything else. There's no special class of objects that must be  
the result.

What's relevant here is that p@x is not a variable and can't be treated  
like one.

Bobby

On Sun, 18 Dec 2011 14:39:56 -0600, Nasser M. Abbasi <nma at 12000.org> wrote:

> On 12/18/2011 11:57 AM, DrMajorBob wrote:
>> p@x is not an "indexed object", whatever that means.
>>
>
> "Making Definitions for Indexed Objects"
>
> http://reference.wolfram.com/mathematica/tutorial/MakingDefinitionsForIndexedObjects.html
>
>> p is a function, and p@x is p at the argument x, or p[x].
>>
>
> p[x] = whatever
>
> is an indexed object not a function. I use indexed objects all
> the time. I just do not know how to use them inside Manipulate
> as a Manipulate Control->None type.
>
> --Nasser
>
>> p@x also is not a variable, so it can't be treated as a variable in the
>> second argument of Manipulate.
>>
>> Bobby
>>
>> On Sun, 18 Dec 2011 03:37:46 -0600, Nasser M. Abbasi<nma at 12000.org>   
>> wrote:
>>
>>>
>>> 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
>>>
>>
>>
>


-- 
DrMajorBob at yahoo.com



  • Prev by Date: Re: Mathematica LogPlot Bug
  • Next by Date: Re: How to define a localized indexed object in Manipulate?
  • Previous by thread: Re: How to define a localized indexed object in Manipulate?
  • Next by thread: Re: How to define a localized indexed object in Manipulate?