5 replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
source | link

You need to make the left-hand side of Set a symbol at the time of evaluation. Use With or similar to inject the symbol:

mmsignalnames = {"one", "two", "three"};

With[{lhs = Symbol[mmsignalnames[[2]]]},
 lhs = 5
];

two
5

Another approach that could be important if you are trying to make assignments to symbols that already have values is this:

Function[{lhs}, lhs = 7, HoldAll] @@ MakeExpression[ mmsignalnames[[2]] ] ;

two
7

Or a bit more terse using the "injector pattern""injector pattern":

MakeExpression @ mmsignalnames[[2]] /. _@x_ :> (x = 9);

two
9

Also, it bears mentioning that one may also use indexed symbols such as

name["two"] = 5;

name["two"]
5

For another approach to this kind of problem see:

You need to make the left-hand side of Set a symbol at the time of evaluation. Use With or similar to inject the symbol:

mmsignalnames = {"one", "two", "three"};

With[{lhs = Symbol[mmsignalnames[[2]]]},
 lhs = 5
];

two
5

Another approach that could be important if you are trying to make assignments to symbols that already have values is this:

Function[{lhs}, lhs = 7, HoldAll] @@ MakeExpression[ mmsignalnames[[2]] ] ;

two
7

Or a bit more terse using the "injector pattern":

MakeExpression @ mmsignalnames[[2]] /. _@x_ :> (x = 9);

two
9

Also, it bears mentioning that one may also use indexed symbols such as

name["two"] = 5;

name["two"]
5

For another approach to this kind of problem see:

You need to make the left-hand side of Set a symbol at the time of evaluation. Use With or similar to inject the symbol:

mmsignalnames = {"one", "two", "three"};

With[{lhs = Symbol[mmsignalnames[[2]]]},
 lhs = 5
];

two
5

Another approach that could be important if you are trying to make assignments to symbols that already have values is this:

Function[{lhs}, lhs = 7, HoldAll] @@ MakeExpression[ mmsignalnames[[2]] ] ;

two
7

Or a bit more terse using the "injector pattern":

MakeExpression @ mmsignalnames[[2]] /. _@x_ :> (x = 9);

two
9

Also, it bears mentioning that one may also use indexed symbols such as

name["two"] = 5;

name["two"]
5

For another approach to this kind of problem see:

4 added 203 characters in body
source | link

You need to make the left-hand side of Set a symbol at the time of evaluation. Use With or similar to inject the symbol:

mmsignalnames = {"one", "two", "three"};

With[{lhs = Symbol[mmsignalnames[[2]]]},
 lhs = 5
];

two
5

Another approach that could be important if you are trying to make assignments to symbols that already have values is this:

Function[{lhs}, lhs = 7, HoldAll] @@ MakeExpression[ mmsignalnames[[2]] ] ;

two
7

Or a bit more terse using the "injector pattern":

MakeExpression @ mmsignalnames[[2]] /. _@x_ :> (x = 9);

two
9

Also, it bears mentioning that one may also use indexed symbols such as

name["two"] = 5;

name["two"]
5

For another approach to this kind of problem see:

You need to make the left-hand side of Set a symbol at the time of evaluation. Use With or similar to inject the symbol:

mmsignalnames = {"one", "two", "three"};

With[{lhs = Symbol[mmsignalnames[[2]]]},
 lhs = 5
];

two
5

Another approach that could be important if you are trying to make assignments to symbols that already have values is this:

Function[{lhs}, lhs = 7, HoldAll] @@ MakeExpression[ mmsignalnames[[2]] ] ;

two
7

Also, it bears mentioning that one may also use indexed symbols such as

name["two"] = 5;

name["two"]
5

You need to make the left-hand side of Set a symbol at the time of evaluation. Use With or similar to inject the symbol:

mmsignalnames = {"one", "two", "three"};

With[{lhs = Symbol[mmsignalnames[[2]]]},
 lhs = 5
];

two
5

Another approach that could be important if you are trying to make assignments to symbols that already have values is this:

Function[{lhs}, lhs = 7, HoldAll] @@ MakeExpression[ mmsignalnames[[2]] ] ;

two
7

Or a bit more terse using the "injector pattern":

MakeExpression @ mmsignalnames[[2]] /. _@x_ :> (x = 9);

two
9

Also, it bears mentioning that one may also use indexed symbols such as

name["two"] = 5;

name["two"]
5

For another approach to this kind of problem see:

3 deleted 6 characters in body
source | link

You need to make the left-hand side of Set a symbol at the time of evaluation. Use With or similar to inject the symbol:

mmsignalnames = {"one", "two", "three"};

With[{lhs = ToExpression[mmsignalnames[[2]]]Symbol[mmsignalnames[[2]]]},
 lhs = 5
];

two
5

Another approach that could be important if you are trying to make assignments to symbols that already have values is this:

Function[{lhs}, lhs = 7, HoldAll] @@ MakeExpression[ mmsignalnames[[2]] ] ;

two
7

Also, it bears mentioning that one may also use indexed symbols such as

name["two"] = 5;

name["two"]
5

You need to make the left-hand side of Set a symbol at the time of evaluation. Use With or similar to inject the symbol:

mmsignalnames = {"one", "two", "three"};

With[{lhs = ToExpression[mmsignalnames[[2]]]},
 lhs = 5
];

two
5

Another approach that could be important if you are trying to make assignments to symbols that already have values is this:

Function[{lhs}, lhs = 7, HoldAll] @@ MakeExpression[ mmsignalnames[[2]] ] ;

two
7

Also, it bears mentioning that one may also use indexed symbols such as

name["two"] = 5;

name["two"]
5

You need to make the left-hand side of Set a symbol at the time of evaluation. Use With or similar to inject the symbol:

mmsignalnames = {"one", "two", "three"};

With[{lhs = Symbol[mmsignalnames[[2]]]},
 lhs = 5
];

two
5

Another approach that could be important if you are trying to make assignments to symbols that already have values is this:

Function[{lhs}, lhs = 7, HoldAll] @@ MakeExpression[ mmsignalnames[[2]] ] ;

two
7

Also, it bears mentioning that one may also use indexed symbols such as

name["two"] = 5;

name["two"]
5
2 added 234 characters in body
source | link
1
source | link