I think in Mathematica the omission of a function that can create a bordered matrix. This code works
m = {{a, b}, {c, d}};
k = {α, β}
l1 = Insert[ k, 0, 1];
c1 = Insert[Transpose[m], k, 1] // Transpose;
m1 = Insert[c1, l1, 1];
m1 // MatrixForm
and gives
$\begin{pmatrix} 0 & \alpha & \beta\\ \alpha & a & b\\ \beta & c & d \end{pmatrix}$
as expected.
So I have tried to design a function. But obviously it doesn't work
bordhess[mat_?MatrixQ[mat], vec_?VecQ[vec] ] :=
Block[{x = mat, y = vec},
l1 = Insert[ y, 0, 1];
c1 = Insert[Transpose[x], k, 1] // Transpose;
Insert[c1, l1, 1]
]
and even If I have been able to create such a function, I wonder how to generalize the problem to many vectors.
ArrayFlatten[{{0, {k}}, {Transpose@{k}, m}}]
$\endgroup$ – Simon Rochester Jan 18 '17 at 9:10