I have a list like this l={1+2s,2+3s,4+1s} and I have calculated s={1,2,3} I need to replace s in l so that l={1+21l = {1 + 2*s, 2 + 3*s, 4 + 1*s}
, 2+32,4+13}and I have calculated s = {1, 2, 3}
. I need to replace s
in l
so that l = {1 + 2*1, 2 + 3*2, 4 + 1*3}
. Is it possible to do that with replace and ruleReplacAll
(/./.
) and Rule
?