Skip to main content

Questions tagged [scoping]

Questions on Mathematica's scoping constructs (Block, Module, With, etc.)

1 vote
4 answers
255 views

The strange goal I want to do something like this ...
Adam's user avatar
  • 4,293
0 votes
0 answers
28 views

The symbols X1, X2, X3, mu, and M already have values as below. The goal is to temporarily clear these variables, perform symbolic calculations with these symbols, ...
Soon's user avatar
  • 1,484
2 votes
2 answers
226 views

I need to draw sth using Plot (example below). I prefer using local variables in Module so that variables don't interfere others ...
feynman's user avatar
  • 451
4 votes
1 answer
216 views

There are certain reasons to write certain variables and expressions in different adjacent sections or subsections. Is it possible to span a module over sections or subsections like this to separate ...
feynman's user avatar
  • 451
0 votes
1 answer
130 views

This is my code: ...
melo's user avatar
  • 13
0 votes
1 answer
132 views

I want to plot the graph of Q versus V, but my code doesn't work, and the output for Q and V are both empty. Could you help me identify the problem? This is my code: ...
melo's user avatar
  • 13
3 votes
2 answers
206 views

The following two functions are identical, apart from the fact that the first one uses Module and the second oneDynamicModule. <...
Fred Simons's user avatar
  • 10.4k
2 votes
4 answers
182 views

I want to allow users to enter some parametrized plots, using the variable t. I want the variable t to be localized to a ...
Daniel's user avatar
  • 470
5 votes
2 answers
400 views

I need to use local indexed variables inside With but it is not allowed, the same for Block and ...
azerbajdzan's user avatar
  • 32.8k
0 votes
0 answers
75 views

I'm working on a project, and I want to Unprotect and ClearAll the properties of NonCommutativeMultiply, but only within a local ...
Daniel's user avatar
  • 470
3 votes
0 answers
68 views

This part will print the change: nomos = Names["Global`*"]; Print @ Complement[Names["Global`*"],nomos]; And in between you can run one of ...
jWey's user avatar
  • 155
2 votes
1 answer
196 views

Apologies for the long question. The question is more pedagogical than practical. I am trying to improve the performance and usability of a simulation and its visualization. The root of the question ...
Craig Carter's user avatar
  • 7,544
0 votes
1 answer
135 views

Can someone explain the principles underlying the following behavior. I define the list testD, and then use a Do loop to change values in the list (I realize there are smarter ways but they don't fit ...
Robert's user avatar
  • 505
0 votes
2 answers
167 views

I am very confused by the difference in behaviour of the following two functions: ...
John's user avatar
  • 101
2 votes
1 answer
155 views

I would like to evaluate a section several times for different values of some variables. I can evaluate it once with a simple command, but not in a loop. To evaluate it only once, this code works <...
Albercoc's user avatar
  • 1,122

15 30 50 per page
1
2 3 4 5
40