https://uk.mathworks.com/help/comm/ref/comm.bchencoder-system-object.html
comm.BCHEncoder - Encode data using BCH encoder - MATLAB
The comm.BCHEncoder System object creates a BCH code with message and codeword lengths that you specify.
commencodedatausingbch