If I have a matrix and a separate column vector, what is the easiest way to merge that column into the matrix? Typically at the front, but potentially at an arbitrary position?
This is what I came up with. I had to do trial and error with adjoints more than seems desirable but it did work. Is there a simpler way? And what if I wanted the new column to go in the interior of the matrix rather than at the front?
data = rand(4,2)
X = vcat(ones(4)', data')'
Not sure what that transpose is coming up red here. It didn’t do that in Jupyter-- guess its just syntax highlighting getting confused