# Questions tagged [variable]

Questions on the use or manipulation of Mathematica variables (i.e. names associated with a changeable value). Use [variable-definitions] or [assignment] for questions on variable context localization, or assignment.

251 questions
Filter by
Sorted by
Tagged with
29 views

### Replace the output of a module containing local variables by their actual value

I want to construct a function as the output of a Module, but I obtain the local variables as part of the output. This is a problem when I try to construct many of these functions in a parallel table, ...
55 views

### Solving equation for unknown and replacing it in second equation

I am new to Mathematica and struggling with its syntax. I have a set of equations, which I would like to solve for my unknowns. I would like to solve the first equation for the first unknown and ...
76 views

### Issue with several replacements in a function under certain conditions

I am trying to define a function (reduce[x]) which does several substitutions, depending on the values of certain parameters. Concretely, consider an expression x, which contains an arbitrary number ...
140 views

### Desktop vs. Cloud option, home plan vs. basic plan: syntax differences

I do not understand why the following simple expression is accepted using a browser (cloud option), but is not accepted using the installed software (desktop option) with the plan basic of Wolfram ...
53 views

### How to do importance sampling to estimate variance?

For a random variable X with density $q(x)=e^{(1/3)∗|x|^3}$, I can estimate its variance by numerical integration method. Then, how can I do importance sampling using a standard normal proposal (...
43 views

### Extension of Coefficient to variable exponents

Say I have an expression that is a polynomial in a variable, for example in the variable $x$, in which terms appear for which the exponent of $x$ also includes variables. For example: ...
51 views

### Mathematica says that a variable is not defined, yet it gives me a value [duplicate]

this is probably a dumb question (Mathematica noob here) but I can't figure out what's going on. I have a variable that I assign a value to and use, then later in the notebook I assign it a different ...
53 views

### Why some variables get substituted and others don't

I was running into some trouble with my math and I whittled it down to this nugget: ...
81 views

### Use a variable to represent another variable?

I'm trying to create a list of functions by replacing variables in a template. I tried this: ...
80 views

### how to define an example of ODE that represents an undamped forced oscillator whose time evolution is described by beats

I am a newbie in Mathematica and I really don't know how to define an example of ODE that represents an undamped forced oscillator
51 views

### Changing the dependent variable

I'm using NDSolve to solve a set of ordinary differential equations. The output is something like. ...
31 views

### No Solution For Solve with Free Variable [duplicate]

Mathematica returns no solutions for this simple query: Solve[a*x == x && x != 0, {x}] (* output: {} *) Clearly, when a ...
61 views

### How to asign well numerical values efficiently before to plot?

A problem is presented when the substitution of the numerical values for this function ...
48 views

### Issue with calling one notebook from inside another one

I am calling one notebook (N2) from inside another notebook (N1). The results are transferred correctly from the second notebook to the first one. But when I try to compare the results from the two ...
37 views

### How to Append the value of a variable and not the variable itself

So lets say I have a = Some complicated code that changes list = {} AppendTo[list, a] Obviously it would give me ...
65 views

### Using an if statement to assign a value to a variable

New Mathematica user here. I'm using some code from a colleague and editing it to give me more specific results in finding the zeros of a complex polynomial. I am attempting to find a way to assign a ...
63 views

### Better way for constant expressions in functions than storing as global variables?

For example, I wrote a function like this: inversions[list_] := Complement[ Subsets[{1, 2, 3, 8, 4, 7, 6, 5}, {2}], Subsets[list, {2}] ] But as you see, ...
164 views

41 views

### Assign variable array as function input and generate slider inputs for Manipulate

New to Mathematica. I want to be able to input some parameters, do some calculations, and end up with some output in a functional form such as: ...
265 views