MATLAB: Solving an integral to get a numerical answer

MATLABnumerical integrationsymbolic

I am struggling to solve an integral and get a definite numerical answer from it in Matlab
Here is the code that I am using:
syms r C z x I u_0
k(r,C,z) = (2*sqrt(r*C))/(sqrt(r+C)^2+z^2);
fun_K(r,C,z) = 1/(sqrt(1-k^2*sin(x)^2)); % function K
K(r,C,z) = int(fun_K,x,0,pi/2); % integral of function K
fun_E(r,C,z) = sqrt(1-k^2*sin(x)^2); % function E
E(r,C,z) = int(fun_E,x,0,pi/2); % integral of function E
% print out result
r = 0.004; C = 0.025; z = 0.03;
K(r,C,z)
E(r,C,z)
From this, I get the elliptics:
K(r,C,z) = ellipticK(40000/89401)
E(r,C,z) =ellipticE(40000/89401)
Is it possible to get a numeric answer from this to then use later in calculation or am I doing something fundamentally wrong here?
Thanks in advance.

Best Answer

First, you can probably use the double function, or the vpa function first, then double.
Second, your code throws this error:
Undefined function or variable 'x'.
fun_K(r,C,z) = 1/(sqrt(1-k^2*sin(x)^2)); % function K
When I try to run what you’ve posted.
I could be of more help if you correct that, since neither MATLAB nor I know what ‘x’ refers to here.