The odefun can be obtained using syms command
syms M x z Y alpha V_0 l h_0
V = V_0 * ((exp(-alpha * z) - 1)^2 - 1)
We get
expressed by -(2*V_0*alpha*exp(-alpha*z)*(exp(-alpha*z) - 1))/M
According to your explaining, the ode equations are
and 
which can be implemented by an ode equation numerically
ftotal = @(t, Y, V_0, alpha, M)[ Y(2);
-(2*V_0*alpha*exp(-alpha*Y(1))*(exp(-alpha*Y(1)) - 1))/M;
Then you can use the your code following
ftotal = @(t, Y, V_0, alpha, M)[ Y(2);
-(2*V_0*alpha*exp(-alpha*Y(1))*(exp(-alpha*Y(1)) - 1))/M;
E_z = E_i * (cos(theta_i))^2;
p_mag = sqrt(2 * M * E_i);
p_x_i = p_mag * sind(theta_i) * cosd(phi_i);
p_z_i = - p_mag * cosd(theta_i);
ic = [20 * A; p_z_i/M; -10 * A; p_x_i/M];
tspan = [-2 * ps, 2 * ps];
[T,Y] = ode45(@(t,Y) ftotal(t, Y, V_0, alpha, M), tspan, ic);
The figure plotted is shown below