Getting the convolution weights should be as easy as your example.
Are you instead trying to find a matrix M that represents your convolution such that if you multiply your input by this matrix you’ll get the corresponding output? Something like this? neural network - 2-D convolution as a matrix-matrix multiplication - Stack Overflow 1