How to implement tinv manually? Without Statistics and Machine Learning Toolbox

As an exercise, I am trying to implement ttests manually, without using the Statistics and Machine Learning Toolbox. To obtain the p-value from the t-value, I have used Star Striders excellent method. http://www.mathworks.com/matlabcentral/answers/20373-how-to-obtain-the-t-value-of-the-students-t-distribution-with-given-alpha-df-and-tail-s Now, I wish to determine the confidence interval. For this, the critical t-value is needed. With the toolbox, you just use tinv according to http://www.mathworks.com/matlabcentral/answers/20373-how-to-obtain-the-t-value-of-the-students-t-distribution-with-given-alpha-df-and-tail-s My question is, is there any way to do this without the Statistics and Machine Learning Toolbox? More exactly, how to implement tinv?


Link to Full Article: How to implement tinv manually? Without Statistics and Machine Learning Toolbox