I have a list {a,b,c,d}
, and I want to set the 1st element and the 3rd elements equal to 5 and 8, respectively, leaving 2nd and 4th as they are ({b,d}
used later). How is this done?
Later, I want to set the 2nd element and the 4th element to other numbers, then 1st and 2nd, and so on... I spent a lot of time working on this (yup, embarrassed) but cant find a solution.
list = {a, b, c, d}
, then dolist[[{1, 3}]] = {5, 8}
etc. $\endgroup$a/c
? Do you want this to work once they have values etc? $\endgroup$list /. {a->5, c->8}
? $\endgroup$