The H matrix generated by my function is not working with this encoder method, but the H matrix from an example in the text is. So this example will use the H matrix from the text while I troubleshoot the problem with the matrices being generated by my function.
Changing function name to something more general, and changing my variable name to not be the same as the function name.