From simulink to APM

Hello everyone.
I am student, i did a model in simulink to control the drone. i did my simulation with x-plane.
i generate he code in matlab, now i want to upload my code into apm
have you an idea for that ??!!
thanks