0
$\begingroup$

I would like to assign different values for x in the following list, in other words, say, x=6 in the first entries assign , x=6.1 in the 2nd, x=6.2 in the 3rd and so on. How can this work be done?

{A1 x , A2 x^2 , A3 x^3}

Thanks.

$\endgroup$
  • 1
    $\begingroup$ This is a very poorly posed question. 1) " in the following list"; what following list -- I see no list. 2) What are A1, A2, and A3? I don't know how you expect to get answer. We are not psychics. $\endgroup$ – m_goldberg Feb 11 '17 at 10:18
1
$\begingroup$

I think you want to generate lists for different values of x.

Assuming A1, A2, and A3 are constants.

list = {A1 x, A2 x^2, A3 x^3};
listDiffXValues = list /. {x -> #} & /@ {6, 6.1, 6.2}
(*{{6 A1, 36 A2, 216 A3}, {6.1 A1, 37.21 A2, 226.981 A3}, 
{6.2 A1, 38.44 A2, 238.328 A3}}*)
$\endgroup$
1
$\begingroup$

I understood the question differently. I assumed you wanted to assign to each x in the first list a corresponding value from the other list in the order they show up? if so, One way could be

ClearAll[x]
list = {A1 x, A2 x^2, A3 x^3};
values = {6, 6.1, 6.2};
Inner[Function[{r1, r2}, r1 /. x -> r2], list, values, List]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Excellent. very thanks. $\endgroup$ – PhysicsExams Feb 11 '17 at 17:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.