Questions on assigning and unassigning definitions to names that represent them, including issues raised by context and localization. Use tag [assignment] for issues relating to Set versus SetDelayed.
8
votes
4answers
235 views
how to differentiate formally?
I have been wrapping my head around this for a while now and I have not found a solution so far.
I want to work with an arbitrary number of variables in mathematica and use some built in functions.
...
1
vote
0answers
47 views
Evaluating a function on permutations of its arguments
Say I have a function "temp" of $n+1$ variables, $y,z1,z2,z3,...,zn$. I want to test if my function has certain symmetries like swapping $y$ with square of any $z$, swapping any two of the zs, ...
5
votes
1answer
68 views
Reloading package after accidental Remove[] of symbol
I was using Needs["PlotLegends"] By chance I removed ShowLegend by Remove[ShowLegend]
How do ...
1
vote
3answers
101 views
How to create functions of arbitrary number of variables?
In the following code what would be the simplest way to generalize it to say some $N_f$ number of $z$ instead of just $z_1$ and $z_2$?
...
3
votes
1answer
61 views
Using external variable as a variable inside WhenEvent & NDSolve
I'm trying to use the new WhenEvent functionality of NDSolve in Mathematica 9, in order to perform an action when a variable in the system reaches a certain value. I would like this variable to come ...
0
votes
0answers
42 views
What's the best practice for nested local constants? [closed]
Possible Duplicate:
How to avoid nested With[]?
I have many situations where I have a constant that is local to a function, with other constants that are computed from it. I see that I can ...
3
votes
3answers
135 views
How to Clear variables with apostrophe?
An apostrophe ' is often used when we want to distinguish two variables. For example, if we already have a variable t and we may ...
16
votes
2answers
185 views
Is there equivalence within Mathematica to view currently used variables similar to Matlab?
For example, in Matlab, a panel is available where one can see straight away which variables are used and dimension sizes, is such feature available in Mathematica? I really find it hard to scroll up ...
-3
votes
2answers
84 views
I want to define this function [closed]
I want to define this function, and plot it.
y(x) = (x~=0) x^2 * sin(1/x)
(x==0) 0
Therefore, I define it in Mathematica such a way that...
y[x_] = x^2 Sin[1/x] /. y[0] -> 0
But it returned ...
2
votes
2answers
146 views
local variable naming & symbolic argument
I'm stuck here with my variable assignment in this scenario
...
0
votes
3answers
92 views
Better solution than returning a list of 3 values?
I have a function (using SetDelayed) that currently returns 3 values in a list. Later on I use the result of this list along with ...
1
vote
0answers
48 views
Context “Unique to This Notebook” makes variables black even if they're not defined?
I'm trying to use this technique to keep variables separated between different notebooks. It seems to be working fine, except that variables turn black as soon as they are evaluated — any ideas why ...
3
votes
0answers
42 views
What's reliable way of finding declared but undefined functions/symbols in several interrelated packages?
I have many packages some of which use some of others. I have many symbols defined in them. Is there a reliable way of finding declared/exported but undefined functions/symbols in several ...
12
votes
1answer
104 views
Is it possible to Clear all variables (but not functions)?
I have written a Mathematica script in which I define functions and variables. Here is a vastly simplified example:
...
4
votes
2answers
121 views
Elegant manipulation of the variables list
I have a list of global variables (some of them are indexed variables), for example:
varsH = Hold[U0[1], U0[2], B0, V0[1], V0[2]]
Or (if it is easier to handle) ...