how to perform a paired t test on two groups in matlab

main.m
% Create two groups of data
group1 = [72, 73, 75, 78, 70];
group2 = [70, 71, 69, 72, 68];

% Perform paired t-test
[h, p, ci, stats] = ttest(group1, group2);
disp(['The p-value is: ', num2str(p)])

% Display the confidence interval
disp(['The confidence interval is: [', num2str(ci(1)), ', ', num2str(ci(2)), ']'])
315 chars
11 lines

related categories

gistlibby LogSnag