How to define local variables and constants in mathematica

  • Mathematica
  • Thread starter yashar
  • Start date
  • #1
31
0

Main Question or Discussion Point

hi
suppose i run Two notebook and in each of them i have matrix A and Constant B and a function C
in each notebook these things have the same name.
if in notebook 1 i assign B=10 then in notebook 2 B is 10 too , which is not my desire.
how can i define these constants and matrices and functions so that they are not affect each other in each notebook.
i do not want to rename one of these entities.

thanks
 

Answers and Replies

  • #3
313
1
You can handle this behaviour using Contexts. Under the Evaluation menu, choose "Notebook's Default Context" > "Unique to This Notebook".

Now each notebook will be using different name spaces, and the variables won't clash.
 
  • #4
31
0
thanks
 

Related Threads on How to define local variables and constants in mathematica

Replies
1
Views
7K
Replies
3
Views
20K
Replies
3
Views
3K
Replies
4
Views
317
Replies
1
Views
2K
Replies
4
Views
5K
Replies
8
Views
3K
Top