I'm trying to write a script that will dynamically update, except for one variable, say y
in a block
Dynamic@F[x,y]
So that it doesn't get re-evaluated when I reopen the notebook.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityYou might want to describe the problem you are trying to solve in more detail, the comments indicate that people aren't sure about that. Here is what I think could be what you are after:
With[{x = x},Dynamic[f[x, y]]]
using With
you can insert the current value of x
into the Dynamic
as a constant, so it will not change anymore. Whenever the definitions for y
or f
change, the Dynamic
will fire using the value of x
which it had at evaluation time of the above expression. There are several other techniques to achieve the same thing, but I think With
is probably the easiest of these to understand...
F
to evaluate, butx
not. $\endgroup$Dynamic[F[x, y], TrackedSymbols :> {F}]
and now only changes inF
trigger an update $\endgroup$