I have a data file which I have imported and form a table.
list1 = Flatten[Table[{relic[[i]]}, {i, 1, 5}], 1]
the output looks like this
{{4.992596228629734*^-14}, {9.985192457259468*^-14},{1.49777886858892*^-13}, {1.9970384914518936*^-13}, {2.496298114314867*^-13}}
I have another list
masslist = Reap[For[i = 2, i <= 50, i = i + 10, Sow[i]];][[2, 1]]~Partition~1
output is
{{2}, {12}, {22}, {32}, {42}}
Now I want to form another table by multiplying the elements of the two lists. I used this
newlist = Table[{masslist[[i, 1]], masslist[[i, 1]]*list1[[i, 1]]}, {i, 1, Length[masslist]}]
But that is not working. It gives an output like this
{{2, 2 4.992596228629734*^-14}, {12, 12 9.985192457259468*^-14}, {22, 22 1.49777886858892*^-13}, {32,32 1.9970384914518936*^-13}, {42, 42 2.496298114314867*^-13}}
I think is not working because of the number format of the first list. Can you please help?
masslist = List /@ Range[2,50,10]
is the Mathematica way of doing it (not asking why you want the elements to be lists...). For me the rest works fine, you may have some conflicting definitions - try a fresh session. $\endgroup$relic
?) so that people can reproduce your results. $\endgroup$Head@list1[[1,1]]
to verify that you have aReal
number. If not, then you may need to useToExpression[]
or equivalent. $\endgroup$