I have a matrix and a list of the following
m={{a1,a2,a3},{b1,b2,b3},{c1,c2,c3},...,{z1,z2,z3}}; l={4,5,6}
I want to add l
to m
by taking all the possible combinations into account, so the combined matrix should look like
updatedm={{a1,a2,a3,4},{a1,a2,a3,5},{a1,a2,a3,6},{b1,b2,b3,4},...,{z1,z2,z3,4},{z1,z2,z3,5},{z1,z2,z3,6}}
How may I can do this job? I think KroneckerProduct
should work in this case, but the outcome with the function is a little bit different.. it produces {{a1,a2,a3,4,5,6},...,{z1,z2,z3,4,5,6}}
...