Undefined function or variable 'x'.
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
This is a function that conducts t-tests.
x=[197, 161, 144, 162, 185, 154, 136, 130]
% y=[204, 182, 140, 178, 183, 163, 156, 143]';
%
% Usage:
% [CI, tcrit, H, Pval, tstat, df] = myttestfcn(x, y, testtype, side, alpha)
% x = vector of operations
% mu0 = hypothesized mean
%
% testtype = 0 if Welch’s t-test
% = 1 if Pooled t-test
% = 2 if Paired t-test
%
% side = 0 if two-sided test
% = 1 if left-sided test
% = 2 if right-sided test
%
% alpha = the level of the test a number on interval (0,1)
% Confidence level = 1 - alpha
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [CI, tcrit, H, df] = myttestfcn(x, y, testtype, side, alpha)
0 Kommentare
Antworten (1)
Walter Roberson
am 24 Nov. 2016
Your line
x=[197, 161, 144, 162, 185, 154, 136, 130]
should be commented out. The code from "Usage:" on down should be saved in myttestfcn.m . To invoke the function you will need to go to the command line and invoke it there, such as
x=[197, 161, 144, 162, 185, 154, 136, 130];
y=[204, 182, 140, 178, 183, 163, 156, 143]';
[ci, crit, h, df] = myttestfcn(x, y, 2, 1, 0.5)
0 Kommentare
Siehe auch
Kategorien
Mehr zu String Parsing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!