MatLab has a number of built-in ODE solvers and are named using the convention odepq, for exampleL ode45, ode23, etc.
I understand that $p$ here stands for the order of the numerical method. For example, when using Euler's method, this is an order 1 because you only need to substitute the value of the function once before going on the update equation. As opposed to 2 times for Heun's and midpoint method (hence order 2). Classical RK method is order 4.
What I don't understand is the $q$ part. What is it?
5 is for the error estimate order - RK4's local truncation error is order of $O(h^5)$.