Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Checking dynamically updated variable' topicStudent Support Forum > General > Archives > "Checking dynamically updated variable"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Michael
01/09/13 3:47pm

A couple of issues:

k4x = N[1/100*k4[[1]]] // Dynamic;

1. This sets k4x equal to Dynamic[ N[ 1/100 * k4[[1]] ] ], which doesn't seem to be what you want.
2. The semicolon prevents the expression from appearing in the front end (in the notebook); in such a case, the Dynamic[expr] is inactive. It (or its cell) has to be visible in the notebook for it to be active.

One way to fix it is this:

InputField[Dynamic[k4]] // Print;
(k4x = N[1/100*k4[[1]]]) // Dynamic

The way I would do it is this:

InputField[Dynamic[k4, (k4 = #; k4x = N[ 1/100 * k4[[1]] ]) &]]

(But I may not have the same thing in mind as you.)

URL: ,

Subject (listing for 'Checking dynamically updated variable')
Author Date Posted
Checking dynamically updated variable PhysicsGuy 01/08/13 10:18pm
Re: Checking dynamically updated variable Michael 01/09/13 3:47pm
Re: Re: Checking dynamically updated variable PhysicsGuy 01/09/13 9:05pm
Re: Checking dynamically updated variable PhysicsGuy 01/09/13 11:55pm
Re: Re: Checking dynamically updated variable Michael 01/10/13 4:15pm
Re: Checking dynamically updated variable PhysicsGuy 01/10/13 7:29pm
Re: Re: Checking dynamically updated variable Michael 01/11/13 9:29pm
Re: Re: Re: Checking dynamically updated variable PhysicsGuy 01/12/13 8:18pm
Re: Re: Re: Re: Checking dynamically updated va... Michael 01/13/13 9:41pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic