The file ballTrajectoryFun.m is a script, not a function. Functions start with the keyword "function". If they are called from ODE45, they must accept at least 2 inputs and reply at least one output.
Providing the parameters as 5th input is outdated for over 10 years. Use an anonymous function instead:
[tOut, XOut] = ode45(@(t, y) ballTrajectoryFun(t, y, param), tSpan, X0);
And the function to be integrated starts with:
function dy = ballTrajectoryFun(t, y, param)
Do not use clear all in productive code, because it wastes a lot of time. For short hacks a clearvars might be okay instead.