Mathematica is remember variable values it shouldn't be

  • Context: Mathematica 
  • Thread starter Thread starter rynlee
  • Start date Start date
  • Tags Tags
    Mathematica Variable
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 3K views
rynlee
Messages
44
Reaction score
0
Hi There,

Once I put in values for variable farther down the code from when I first use them (I initially want them just in variable form, I don't want their values defined), every time I evaluate the cell mathematica puts the values in farther up.

Even more disturbing, however, is in other cells that are even above that cell, those variables get defined.

Even more disturbing, when I put the Clear[] function in the appropriate places, mathematica still assigns values to those variables!

Is this a bug? Or am I seriously misunderstanding something?

Thanks for any help or advice!
 
Physics news on Phys.org
Scratch that, I believe I got it working with appropriate Clear[]'s placed for all the variables of interest. It seems that once you put a value for a variable in and it is compiled, mathematica stores that value unless it is cleared?
 
That's right. The notebook is not spatially linear. In essence it's just a pretty interface to the kernel.