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.

learn more… | top users | synonyms

0
votes
2answers
42 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 ...
0
votes
1answer
103 views

Setting components of a matrix [on hold]

Suppose that we want to find some $N\times N$ matrix $A$ under some conditions. In doing so in mathematica, first I will set components of $A$ as follows: $A = \{\{a_{11},a_{12},a_{13},...a_{1N}\},......
0
votes
0answers
39 views

Approximation number and remove the extra numbers [on hold]

I want to approximate a number and capture it in a variable, but when I want to work with that variable the extra number that I wanted to remove in approximation gets involved. Can any one help me? ...
2
votes
0answers
30 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: ...
1
vote
1answer
78 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 ...
1
vote
2answers
141 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 ...
0
votes
0answers
32 views

Protected Variables in Parallel Loop [on hold]

I am trying to run the code below. ...
1
vote
1answer
38 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 ...
2
votes
1answer
54 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: ...
3
votes
1answer
79 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!
3
votes
1answer
68 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 ...
0
votes
1answer
35 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 ...
0
votes
1answer
36 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 ...
1
vote
1answer
48 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'...
1
vote
2answers
39 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 ...
7
votes
1answer
109 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 ...
3
votes
2answers
110 views

Button with loop that iteratively updates slider in Manipulate

I have the toy Manipulate. ...
0
votes
1answer
37 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 ...
6
votes
2answers
151 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 ...
2
votes
2answers
89 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 ...
4
votes
1answer
122 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: <...
2
votes
2answers
73 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 <...
1
vote
0answers
68 views

Binding a variable to an unbound variable [closed]

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

How to use the variables from Table in calculation

New to the site and Mathematica. I'm trying to use the finite element method to get a temperature profile. So if $q_0=f(T_0,T_1)$, $q_n=f(T_{n-1},T_n)$ and we also know that $T_1-T_0=T_2-T_1=T_3-T_2=\...
1
vote
1answer
56 views

Create a list of variables of a function

How can I create a list of variables of simple functions with arguments? These functions will be defined by the user, to be manipulated with some code later. ...
1
vote
0answers
31 views

How to list all user-defined variables with current values? [duplicate]

How to get a list of all user-defined variables and those current values in the current .nb? Maybe it's a (too) simple question, sorry if so, but the answer would help me a lot in debugging some ...
1
vote
1answer
236 views

Duplicate Mathematica functionality in Mathematica clone or lisp [closed]

What is the easiest way to accomplish the following in a Mathematica clone or in any version of Lisp? Also it doesn't appear in any lisps have a similar replace function. ...
4
votes
1answer
220 views

How to make Mathematica express an equation in terms of previously defined functions

I was given a problem for my physics class, and perhaps I have taken it too far, but I wish to finish what I started. I have a function (i warn you that this does not look pretty) ...
0
votes
1answer
59 views

Global variables [closed]

I have a workbook I am writing, there are 2 cells in it and then each cell is divided into sub cells. At the top of the first cell i made a bunch of variable assignments such as length=10, x=6, d=4, ...
2
votes
1answer
73 views

Assiging random values to an array of variables [closed]

I want to create a number of variables and assign random values to them. This is possible in Python using a single line of command. To be more specific say I want to create 10 variables whose value ...
0
votes
1answer
55 views

How to give more importance to a variable in a chart

I have two variables, x and y. x goes from 0 to 10, 10 being best. ...
1
vote
0answers
40 views

How to avoid import evaluation until if wil return true

My goal is to import a data from url that depends of 1 parameter, this initialy value is null or undifined en yo have to selec some popup and then the variable has value, what is the method to do that?...
1
vote
1answer
163 views

Adding letters and numbers to create a variable name [duplicate]

Let's say I have several variables, named R1, R2 and R3. I wanted to have a function ...
2
votes
0answers
53 views

Defining a function which takes lists as it arguments and threads over them [closed]

I want to define a function with lists as variables, which has the form like m = Table[2, {i, 5}]; f[x_, y_] = m*x + x*y; x and y are list variables; m is a ...
2
votes
1answer
71 views

How to choose variables of specific form

I am trying to work on a problem with a probability distribution. I wanted to get the result in analytical form. Suppose I need to keep p1, p2, p3, p4 variables such that p1+p2+p3+p4=1; How to use ...
2
votes
1answer
108 views

Is it possible to find the size of a variable in a notebook?

I have a fairly large a list of matrices matsLst, which takes about 15 minutes to compute (but computes successfully each time). I can test in the notebook that ...
1
vote
1answer
314 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 ...
0
votes
0answers
40 views

Symbol-handling, force-replace instanced variables within functions! [duplicate]

Currently I am stuck with the issue of renaming an instanced variable like r1$23314 to a global one. This issue arises as I need to use a "localizeAll" Module in ...
0
votes
0answers
49 views

Need help with notations [duplicate]

I can't create a custom variable with notation. Where is my problem? I have a big computation and I need to convert it to LaTeX. ...
2
votes
0answers
86 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 : ...
1
vote
1answer
126 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] ...
2
votes
2answers
89 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
0
votes
1answer
65 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.
1
vote
1answer
78 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 ...
0
votes
1answer
97 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 ...
0
votes
1answer
135 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?
1
vote
1answer
93 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: ...
0
votes
1answer
84 views

Variable change

If I have the following Hamiltonian: ...
1
vote
2answers
82 views

Solutions to multivariate equation

Is there any way to get Mathematica to give a set of solutions (pairs of x and y that are integers) to an equation with multiple variables? Something like: ...
1
vote
1answer
79 views

Problem using variable loaded from TextField

I'm trying to make a simple app, which loads some data via TextFields and then does something with that, but ... ...