MATLAB: I want to compute a cdf for t distribution

mathematical- statistice

i want to compute a cdf for t distribution from a to b , i wrote this code but it didn't run
for i=1:50
fa(i)=cdf('t', 'mu' =-2, 'sigma'= 4 , 'nu'= 6 , astar(i))
fb(i)=cdf('t', 'mu' =-2, 'sigma'= 4 , 'nu'= 6, bstar(i))
end
astar and bstar are points of the integral
sorry for a weak my language

Best Answer

You are not calling cdf correctly. Also the functions are vectorised, so you do not need the loops.
Try this:
fa = cdf('T', nu, astar);
fb = cdf('T', nu, bstar);
It is probably best to use the tcdf (link) function instead, since cdf appears to be deprecated in a future release of MATLAB.