I wish to create a matrix as displayed in the encircled region on the right
(taken from here)

However, the code on the left does not seem to be generating the vertical through the matrix. Instead I am only getting one horizontal bar through the matrix.
Can someone please provide a simple code that generates the block/partitioned matrix on the right?
Thanks!

\hlineand{c|c}? – John Alexiou Aug 15 '18 at 14:20