MATLAB: Ttest function not working

Statistics and Machine Learning Toolboxttesttwo-sample t-test

I am trying to implement an independent samples ttest comparing two data sets (X and Y). Here is what I used: [h,p,ci,stat] = ttest2(X,Y)
Here is the error I receive: Undefined function or method 'ttest2' for input arguments of type 'double'.
Not sure why it's not locating ttest function. I'm in the main MATLAB directory. I appreciate any help.

Best Answer

It's probably in the Statistics Toolbox. Do you have that? Use "ver" to find out.