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

27 questions
Filter by
Sorted by
Tagged with
5k views

### Extracting variables from an expression

I'm looking for a way to extract a list of variables from an expression, for example with an input like: ...
1k views

### Generate list of strings from a list of assigned variables

How do I generate a list of strings from a list of assigned variables? E.g. convert ...
408 views

### For any symbol, how can I get the full context-qualified name of the symbol as a string?

I'd like to have a function, whether built-in or not, that when given a symbol, whether bound to a value or not, returns a string giving the context and name of the symbol. Example: ...
1k views

### Get all variables in an expression with Variables[] [duplicate]

"ϕ" <> "1"; Variables[%] Exp["ϕ" <> "1"]; Variables[%] Exp[Subscript[ϕ, 1]]; Variables[%] Say I have lots of variables used for construct an ...
2k views

### Display variable name instead of value

Is there a way to display the variable name instead of its value? for example, I need something likevarname = 1; function[varname]; and the output is ...
905 views

### How to use Table to assign values to variables in a list?

I'm trying to do the following: R = {a, b, c, d, e, f, g, h, i}; Table[R[[n]] = RandomInteger[{0, 20}], {n, 1, Length[R]}] My intention is to assign a random ...
6k views

### Using Array Elements as Function Arguments

Suppose I have an array p = {a,b,c,d} and a function f that takes a variable number of arguments. I want to evaluate ...
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 ...
247 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!
531 views

### Combining Multiple Lists

Let's say I have 4 lists: list1 = {a,b,c,d}; list2 = {e,f,g,h}; list3 = {i,j,k,l}; list4 = {m,n,o,p}; I can combine them using Join ...
364 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, ...
390 views

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