( funcompk.m ):
A MEX file is a dynamically linked subroutine written in C/C++ (or Fortran) that can be called directly from MATLAB like any built‑in function. Once compiled, it runs much faster than interpreted .m code — especially for loop‑heavy tasks like numerical integration in PK models. mex funcompk