Integrate Matlab code into Ardupilot soure code

Hi,everyone,I have some questions concerned about integrating the matlab code into ardupilot. I want to use the algorithm called support vector machine(svm) to classify the data . Now I have written the svm code using matlab , but I am not sure which type of file I should use.

Should I convert the matlab code into dynamic library or static library ?
Does anyone have similar experience for integrating the matlab code into ardupilot soure code?
Thanks in advance for your replying!

Join discord and bring your ideas forward to the developers and with rest of the community