Given the two lists below, is there an in-built command or otherwise neat way of accomplishing the desired output.
list = {{1, 2}, {5, 2}, {9, 3}, {6, 5}}; x = {x1, x2, x3, x4, x5, x6, x7}; desiredOutput = {{1, 2, x1}, {5, 2, x2}, {9, 3, x3}, {6, 5, x4}}; My attempt seems ugly:
{list[[#]][[1]], list[[#]][[2]], x[[#]]} & /@ (list // Length // Range)