Another possibility is to evaluate the integral that defines the incomplete beta function using quadrature. In Matlab you can use the integral function (use quadgk if you have an older version of Matlab)
y = integral(@(t)t.^(a-1).*(1-t).^(b-1),0,z)./beta(a,b)
where the output is divided by beta(a,b) to obtain the regularized incomplete beta function matching betainc. This can be vectorized across z with
f = @(t)t.^(a-1).*(1-t).^(b-1);
for i = numel(z):-1:1
y(i) = integral(f,0,z(i));
end
y = y./beta(a,b);
The result is about the same speed as using hypergeom on my computer.
Also, note the complete definition of the incomplete beta function and the regularized beta function given at the functions.Wolfram.com site. For certain special combinations of parameters, both the hypergeometric form, and the equivalent integral, need to be evaluated differently. Also, Matlab's beta function will produce errors in these situations as well, as it's based on gammaln under the hood in order to be numerically careful. The symbolic beta function can be used as a substitute: double(beta(sym(a),sym(b))) or mfun('beta',a,b).
betaincis actually the regularized incomplete beta function. The Mathematica equivalent is actuallyBetaRegularized. Also,betaincis a purely numeric function. – horchler Sep 06 '13 at 17:14