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

281 questions
Filter by
Sorted by
Tagged with
112 views

### How to provide input as a set and get a set as output too?

Friends here is the code given to a problem which i have been trying to solve lately but in the first equation i want value of 'k' to be [-1,1] or it should take every value from -1 to 1. And i know ...
1k views

### Checking if all the variables are present in the defined function

I want to check if a user input the function with all the specified variables or not. For that I choose the replace variables with some values and check for if the result is a number or not via a ...
555 views

### How to declare variables with plus/minus sign as subscript/superscript?

I am pretty new to mathematica, so please forgive me if I ask any stupid questions. I want to create a vector $a^{+}=[a^+_{k-2},a^+_{k-1},a^+_{k},a^+_{k+1},a^+_{k+2}]$ and then do some symbolic ...
69 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 ...
104 views

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

I'm trying to run the code: ...
1k 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 ...
696 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: ...
162 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 ...
284 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 ...
102 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 ...
160 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: ...
290 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!
177 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 ...
46 views

### Restricting the evaluation of variables [closed]

Hopefully you understand my question. I m calculating inverse kinematics of a robot and each subsequent value is dependant on the one before. For simple porting into c++ I would like something like ...
83 views

### Manipulate different function and variable

I have list of functions such that test = {test1[a,x], test2[a,x], test3[a,x]}; I would like to plot this three function using manipulation ...
158 views

### assign a value to "elements" of a list, named as a "subscripted variable"

I'm stuck in scripting in Mathematica, since I need to assign a value to "elements" of a list, named as a "subscripted variable" (the subscript is also a variable), but it seems that in Mathematica it'...
79 views

### How to make variable values from evaluation time persist in Manipulate? [duplicate]

In the context of automatic report generation, I am trying to use a For loop to Print out a number of ...
2k views

### What is and isn't a valid variable specification for Manipulate?

I have an expression whose terms have arguments (representing subscripts), like this: myExpr = A[0] + V[1,T] I would like to put it inside a ...
253 views

### Button with loop that iteratively updates slider in Manipulate

I have the toy Manipulate. ...
51 views

### Where is the erroneous assignment that is causing my 'List of equations expected instead of tru' error?

I'm getting one those annoying 'NDSolve::deqn: List of equations is expected instead of True' errors. I have done everything I can think of to Remove and Clear all variables, including restarting ...
564 views

### Ignore some values at return

Is there Mathematica analogue of Python _ (underscore) or Matlab ~, a special variable, that can be used when a function returns ...
161 views

### PasteButton: Pasting expression name without quotation marks?

I am struggling to find a way to use PasteButton to paste the name of an expression (in particular a list) without showing the contents of the expression or without ...
728 views

### How to re-assign values to a List of variables?

The accepted Answer to this similar Question can only be used one time, so it's not suitable for my problem. I do high-dimensional calculations for which I need to make lists of variables, like so: <...
396 views

### How can I use an InputField value as a variable name to save to?

I'm trying to save some settings and results from Manipulate, and I want to be able to save them to different variable names. The code I have is something like <...
90 views

### Binding a variable to an unbound variable [closed]

I'm trying to do something like the following: (minimal example, f2 unbound) ...
813 views

156 views

### Plotting data with four variables; two labels for one of the axes [closed]

I am having difficulty related to 3D plotting task. I have a set of data points in the following form : ...
411 views

### Printing names of indexed variables instead of values

I'd like to display only the variable (indexed variable) name (in symbol form, not in string form) instead of its value in Mathematica. Say I have a variable foo[i] ...
205 views

### Can i change AutoStyles colors for undefined variables?

I want to change from blue to red the color of the undefined variables; but only for the current Notebook
78 views

### Can I name a variable as D(1,0,+1/2)? [closed]

I am trying to use variables with names as D(0,0,0), D(1,1/2,+1/2), etc. but I don't know how to do it.
197 views

### Is it possible to assign a value where the target is itself a variable

If I have a variable x := "a". Is there a way I can use it to assign a value to a, by just referring to ...
269 views

### Change of variables—Galilean transformation

I have a function of two variables, f[x, y], and I wish to do a Galilean transformation, i.e., y = z - v t, where ...
2k views

### How to specify the domain of a variable?

How can I specify for every expression the domain of a variable without using assumptions everytime i have to simplify it?
142 views

### How to make strong assumptions?

Or put in another way, how to make a variable behave as it belongs to a specific domain, even outside the use of simplify or other commands alike? For example: ...