Linked Questions

2
votes
1answer
101 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 ...
364
votes
13answers
78k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
20
votes
5answers
597 views

Reassign values to symbols

I've got a situation where I have, say 4 symbols, a, b, c and ...
45
votes
2answers
1k views

Head and everything except Head?

I have been working on picking expressions apart using Head and Part and encountered a little mystery. Consider the canonical ...
20
votes
5answers
972 views

How do you programatically load data into symbols?

I am trying to convert a list of string names into symbols, which will then be used to store data. I have 24 files (where the name of each file is a member of the list mentioned above) that I need to ...
8
votes
3answers
3k views

Assigning values to a list of variable names

As part of a calculation I need to do something like this Evaluate[{aaa, bbb, ccc}[[ index]]] = {1, 2, 3, 4, 5} so if index is ...
7
votes
5answers
217 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? Eg. Convert ...
4
votes
3answers
189 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 ...
6
votes
2answers
223 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 ...
7
votes
2answers
164 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
247 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 ...
3
votes
3answers
133 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 ...
4
votes
2answers
209 views

why set values in this way doesn't work?

question is as follows define a list ttt={1,2}; and if I set values in this way {ttt[[1]],ttt[[2]]}={3,4} then the value ...
1
vote
2answers
161 views

Why does Evaluate[a[[1]]]=0 assign a value to a variable while a[[1]]=0 doesn't?

I'm trying to do a small page counter with Mathematica, for leting me know about my reading progress on some books. I'm stuck on a problem: ...
1
vote
1answer
169 views

direct assignment to the element in a Table

I have already asked a related question here why set values in this way doesn't work? But I think I have to write the question which I encountered explicitly? ...

15 30 50 per page