Fixed wing Change the controller from PID to intelligent-PID

I want to change the controller of altittude and attitude of the Arduplane firmware from a controller of PID to a Model free controller also known as intelligent PID . Any ideas how would it be possible to do that using matlab and a controller apm 2.6. what would be the work flow?
Do i have to simulate my controller on Matlab and then write the code and edit the firmware?
or there is a method or toolbox that enables the change without so much effort?

This question appears in this forum from time to time. Please use the search function.

You searched for Matlab and/or simulink in this forum and did not find anything?

yes i searched and still searching and couldnt find a simulink model for Fixed wing UAV that can be applied directly to APM.

Yeap, that is the state. There are some small chunks, but not a complete model.