Linked Questions
38 questions linked to/from Elegant manipulation of the variables list
4
votes
3answers
442 views
Using Block with a list of variables
I have a list of variables
var={v1,v2};
which I want to protect/localize during a particular operation. I have decided that I want to use ...
1
vote
0answers
29 views
Assign to variables inside Array, rather than changing array entries [duplicate]
I am generating an Array with symbolic coefficients:
coefficients = Array[c, 3]
> {c[1], c[2], c[3]}
I would like to assign a value to each of these generated ...
0
votes
2answers
715 views
How to assign the values for the Table list?
Now, I want to assign some values for a Table list and I find that
If
{mat[1], mat[2], mat[3], mat[4], mat[5]}={4,23,3,12,1};
it is no problem. But, if we use
...
2
votes
1answer
125 views
Table of references [duplicate]
I have a list of variables (say a, b, c, d, e) that I want to assign in a single command.
{a,b,c,d,e} = {1,2,3,4,5}
would ...
4
votes
0answers
125 views
How to get Symbol[“x”]=3 to work [duplicate]
This is probably a really simple one, but I'm stumped. I want Symbol["x"]=3 to work just like x=3. However I can't figure out ...
1
vote
2answers
1k views
Pass the list of variables into function to change their values
I'm new to Mathematica, so I don't really know, how do what I want, and I don't even know how to google it.
Doing one Mathematica task for my supervisor, I faced the following problem. I need to ...
9
votes
2answers
882 views
How to name a variable with the value of another variable?
A simple but very important (at least for me) question.
In some languages for defining a variable, for example, we can do:
i=10
"d"&i=30
So I have defined the variable d10, and...
d10=30
...
2
votes
3answers
428 views
How to create a writable and clearable symbol? [duplicate]
I'm trying to create several symbols and assign values to them. Here's what currently appears to work:
Evaluate[Symbol["fdds" <> ToString[10]]] = 1
But ...
0
votes
1answer
224 views
A problem with set values
The following code is just an example to clearly explain my problem.
Assume that :
...
2
votes
1answer
188 views
How to extract a variable names (not values) from a list of transformation rules?
I am trying to extract variable names from a list of transformation rules mapping = {var1 -> 'val1', var2 -> 'val2' }. Variables ...
0
votes
2answers
234 views
How do I use a passed-in symbol as a tag to define UpValues?
ClearAll@foo;
foo[tag_] := (
tag /: tag[i_] := tag[[i]]
);
a = {7, 8, 9};
foo[a];
a[2]
I wanted the above to output 8, ...
10
votes
6answers
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
...
3
votes
3answers
155 views
Using a variable to tell Mathematica which existing variable to manipulate
I have an estimation routine I have coded up, I want now to do some tests on it where I pick a particular parameter and run the estimation for differing values of that parameter. What I want is to be ...
8
votes
2answers
745 views
How to Clear variables represented as a list of strings?
Say I have a string list called fullpara
fullpara={"width", "long", "line", "distance"}
And there are corresponding variables ...
3
votes
0answers
230 views
I am missing a function like HoldPattern
Temporary message: I am planning to edit this question, making the examples less confusing and by moving the things that are confusing to a separate question
For any confusion about expressions that ...