I would like to assign a value to a automatically created symbol. Let's say to bij where i and j are integers. I know I could do this with this code:
Do[b[i, j] = f[i, j], {i, n}, {j, n}];
But I prefer bij instead of b[i,j] because the code is shorter and becomes more readable. The problem is that with something like
i = 1; j = 1;
StringJoin["b", ToString[i], ToString[j]] = 2
or
Symbol[StringJoin["b", ToString[i], ToString[j]]] = 2
or
ToExpression[StringJoin["b", ToString[i], ToString[j]]] = 2
one gets always the same error and the value 2 is not assigned to b11 in this case. So how can this be achieved?