Linked Questions

2 votes
3 answers

How can I assign many values each to a different variable? [duplicate]

How can I assign many values each to a different variable? For example, I want to set $a = f(1),\,b = f(2),\,c = f(3),\,\dots,\,z = f(26)$ (generally more variables than these). How can I do this ...
user41614's user avatar
  • 161
1 vote
2 answers

How to assign values to symbolic arrays [duplicate]

My main question is how to assign values to symbolic arrays, in an efficient way. The code below is a simplified version of what I am trying to do and the output I get. Note that because I am using ...
mariodrumblue's user avatar
3 votes
3 answers

Assign Values from Array to Array [duplicate]

I am trying to simply do the following cVec = {a,b,c,d} From another expression, I obtain another vector, say, ...
nicomedian's user avatar
2 votes
1 answer

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 ...
Daniel Barna's user avatar
603 votes
19 answers

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 ...
49 votes
5 answers

How to create symbols from strings and set values for them?

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 ...
Todd Allen's user avatar
  • 2,124
23 votes
5 answers

Reassign values to symbols

I've got a situation where I have, say 4 symbols, a, b, c and ...
Mitchell Kaplan's user avatar
53 votes
2 answers

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 ...
Reb.Cabin's user avatar
  • 8,693
16 votes
3 answers

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 ...
BlueMac's user avatar
  • 711
11 votes
6 answers

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 ...
geordie's user avatar
  • 3,693
8 votes
2 answers

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 ...
matheorem's user avatar
  • 17.2k
10 votes
2 answers

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 ...
Luis Fernando Moura's user avatar
2 votes
2 answers

Why this list has a length of 1?

Here is the code : bb = HoldForm[{aa[1], bbb[2], cc[3], dd[4]}] it returns : {aa[1], bbb[2], cc[3], dd[4]} Which is what I ...
StarBucK's user avatar
  • 2,164
4 votes
3 answers

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 ...
Heterotic's user avatar
  • 306
2 votes
3 answers

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 ...
Ruslan's user avatar
  • 7,172

15 30 50 per page