MATLAB: Matlab triple integral conical gravity

integrationphysics

Hi everyone,
I'm trying to solve a triple integral in matlab, demonstrating the gravity on a point mass inside a cone. I have solved this byy hand and it works fine with a simple u sub. Does anyone have any ideas why my code isn't working. Thanks!
I've tried:
function F = conical_gravity(r,z,th) % parameters
syms G p r th z h
T = (p*G*r*z)/((r^2+z^2)^(3/2));
F1 = int(T,r,0,z)
F2 = int(F1,z,0,h)
F3 = int(F2,th,0,2*pi)
end
this:
syms G p r z th h a
T = (p*G*r*z)*((r^2+z^2)^(-3/2));
q1 = int(T,r,0,z)
q2 = int(q1,th,0,2*pi)
q3 = int(q2,z,0,h)
and this:
syms th r z h G p
T = (p*G*r*z)*((r^2+z^2)^(-3/2));
int(int(int(T,r,0,z),th,0,2*pi),z,0,h)
along with the previous was using integral3.
Any ideas??

Best Answer

Numerical stuff removed since a symbolic answer was needed.