# 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.

216 questions
Filter by
Sorted by
Tagged with
112 views

### Symbolic representation of Class Conditional Probablity as a variable

What is the best way to a create a symbolic variable to represent Class Conditional Probability in Mathematica e.g. $p(A|B)$
98 views

### Is there an easy way to to collect a large number variables into a list or list of lists? [closed]

I have a large number of variables in a notebook from a data analysis routine, the results of which now need to be fed through a mathematical model and various items for visualization. For example, ...
773 views

### How to set variable from imported data

I have an excel file i would like to import as data in mathematica with 3 columns like below: Column 1: the nodal numbers Column 2: the values of mx Column 3: the value of mxy Once ive imported the ...
524 views

### Getting a list of variable names as strings via a function

This is a new twist of an earlier question about how to get variable names as strings from a function. I would like to have a function that returns a list of variable names, each being a string, from ...
95 views

### Is it possible to “escape” numbers so they can be used as a variable name? [closed]

I would like to be able to use numbers in the names of some of my variables, it's simply easier to read that typing TwoPointZero. Is this possible? Or is there an alternative to being able to define ...
244 views

### Creating a List of Symbolized Indexed Variables

I am trying to creat a list of indexed variables (symbols) using the Notation package and Symbolize command. As an example, ...
2k views

### writing the expression for one variable in terms of another variable

I have a polynomial equation with 2 variables, lets say $x$ and $y$. For example: $x^2 + y^3 = 5$ And I want to write the above equation with $x$ on left side expressed in terms of $y$ on right side, ...
92 views

### Controlling the names of integration variables in DSolve

Consider the following command DSolve[{Derivative[2][y][x] == g[x]}, y[x], x, GeneratedParameters -> (Subscript[C, #] &)] With the following result ...
337 views

### Series expansion of a multivariable function to an order n for any number of variables [duplicate]

Suppose I want to expand a multivariable function to an order n. ...
70 views

### Using sub-scripted variables in functions

Is it possible to use subscripts in Mathematica functions, for example f[Subscript[x, a] _] := x^2 However this doesn't seem to work, is there a way to allow ...
60 views

### Assigning variables after solve [duplicate]

I have a set of 4 equations that I solved using the Solve function, resulting in the following output: I want to use these solution for further computations, so basically, I want to assign new ...
69 views

### List output as a variable within a forloop function changes

The above image shows my code. The graph plots my results for two different values of the variable "guards" (1000 and 200), having first produced lists of these figures. What I want is for mathematica ...
84 views

### Best practice for passing variables to many functions?

I am rewriting an application in Mathematica. The previous version used global variables, which I find distasteful, but to avoid it I am needing to pass several static Datasets and Associations around ...
262 views

### Want to return name of last defined variable without explicitly naming it

Suppose I have this code: dec = 7.1 + 6.6 + 27.2 + 66.5 jan = 7.1 + 6.6 + 27.2 + 66.5 + 65.7 feb = 7.1 + 6.6 + 27.2 + 66.5 + 65.7 + 69.7 And I want MMA to return:...
120 views

### Plot multiples of a variable

If I am plotting a square wave s.t.: ...
38 views

### Some challenge for a Table mixing between output number Variables and ToString symbols [duplicate]

How can I output a series of data, ranging from s00, s01, s02, s10, s11, s12, s20, s21, s22; by writing a table with s is a fixed, and m and n are running parameters, for example: ...
114 views

### solving of a polynomial equation with large coefficients

m trying to solve a polynomial equation with degree 4.. i have given the code below.. but it's taking too long and at the end shows a message that it has exceeded the time limit.. please help ...
59 views

### How to make the results form what i want

I have a question that method to make the result form what i want. equation =2 Integrate[-(L^3 h^2 (-2R1+L p0 h))/(2H),{h,0,1/2}] + (p0 L - 2 R1)/k (-2) The ...
51 views

### How to make result arrangement for the variable?

I was calculating equations, p2 := 1 e + r M1^2 p1 := 1 + r M2^2 p2/p1/.M2-> Sqrt[((r - 1)/(2 r))] Simplify@%/.e -> 0 where e : to remove by approximation ...
27 views

### Names of Variables in an Array [duplicate]

Foo={1,2,3}; Bar={4,5,6}; Blech={Foo,Bar}; Is there some way to retrieve the name variable name "Foo" from Blech[[1]]?
49 views

### How can I get plot [closed]

here I want to plot the v vs p ...the code I used here... ...
133 views

### Map[Remove[#]] doesn't seem to do anything

If you have a symbol with a value, you can clear it with Remove[]. Thus ...
331 views

### One inequality with two variables

I would just like to know if this: ((a - b)/(b*Log[b])) - Log[Log[a]] + Log[Log[b]] exceeds 0 for any combination of a and <...
107 views

### Is there any way to enumerate “variables made special by use in arguments”?

I want to create a way to enumerate teal color coded variables in my Manipulate function. Specifically, I would like the user to input a number so that my function ...
113 views

### Returning Sin[t] from package turns into Sin[scope`t] [duplicate]

I have a function in scope that returns an expression with a variable t ...
130 views

### Define new symbols and “inverse” function

I have an expression that involve variables and conjugate of the variables eg ...
124 views

### How can we define lots of variables

I am new to Mathematica and some things I do not understand. Right now I need to write an algorithm which takes a polynomial in many variables, I denote it by $p_{i,j}$, and then I want to apply a ...
70 views

### Periodic function Iteration limit [closed]

I have two main issues. The first concerns Mathematica interpreting the same definition differently based on what I call the function, even though the name never occurs in any other part of the ...
57 views

### Variable calculation

So basically I have some code like this: Manipulate[ With[{ a = h + 5, b = a/2 }], {h, -10, 10}] It works fine for a but doesn't calculate the value of b. the ...
76 views

### Calculating a value

I'm trying to calculate the value of F12 and show the value of it on screen. But for some reason I keep getting Null as an output. ...
105 views

65 views

### converting an operation on multiple arguments into an operation on a list [duplicate]

Let's say I have an operation like Intersection[{1, 2, 3}, {1, 2, 3}, {-1, -2, -9}, SameTest -> (Abs[#1] == Abs[#2] &)] but the arguments are being ...
96 views

### Variable name complication with DSolve? [closed]

I'm trying to run the code: ...
716 views

### Can you unpack a list of values into variables in a With expression?

For instance, if I am trying to draw a graph with 5 vertices labeled a through e, and I want to draw edges connecting a and b, a and c, a and d, a and e, b and c, b and d, and c and e, I would run the ...
506 views

### Protected Variable Error with Workbench 3.0

I have Wolfram Workbench 3.0, build 78, with Mathematica 10.4 as the front end. I am using Windows 10. I am trying to run a simple test source code test.m: ...
121 views

### How can I solve a set of equations with variables and eliminate a few variables at the same time?

I just started learning Mathematica since I needed for my current research. I'm trying to solve a set of equations with different variables, eliminate a few variables in the set, and express one ...
234 views

### Defining a variable with comma (or any other separator) in its name?

How can I define Mathematica variable/function with comma in it? For example, defineL00,1 as a variable? I plan to use L00,1 ...
94 views

### How to call a function with an arbitrary list as its arguments inside a functional? [duplicate]

I have the following functional defined (i.e. a function of another function) where variableList contains the variable (arguments if you wish) of the ...
139 views

### Substituting values of variables in solution of a system of linear equations

After solving a system of 21 linear equations in 21 variables (called Xi in my code) I got the values for all the 21 variables, in the following way: ...
224 views

### An alternative to subscripts?

Are there any good alternatives to using subscripts to keep track of and uniquely identify many variables? I know that subscripted variables behave badly. Thanks!
108 views

### Checking if input is a function

I would like to write a program to find the leading coefficient of a given polynomial. (Sounds easy, right?) I'd like to be able to handle the format x^2-x+7 (with ...