ttest

Statistics

One-sample t-test. Tests whether the mean of x differs significantly from mu (default 0). Returns { t, p, df, ci } with t-statistic, two-tailed p-value, degrees of freedom, and 95% confidence interval.

Syntax

ttest(x)
ttest(x, mu)

Examples

ttest([5.1, 4.9, 5.2, 5.0, 4.8], 5)
▶ Run
result = ttest([2, 4, 6, 8, 10]); result.p
▶ Run

See Also

Try SimLab — Free MATLAB® Alternative

466 functions. Runs in your browser. No install.

Open SimLab

Stay Updated

Get notified about new simulations and tools. We send 1-2 emails per month.