How does lmpc replace ardusub's horizontal controller?

I have a level controller LMPC that can be used with ardusub, I have MATLAB code? However, my understanding of ardusub code is not enough. I want to embed this code into ardusub and hope to get your help.
资料汇总.zip (635.5 KB)