Mercurial > octave-antonio
comparison scripts/statistics/tests/sign_test.m @ 11472:1740012184f9
Use uppercase for variable names in error() strings to match Info documentation. Only m-files done.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 21:33:04 -0800 |
parents | a1dbe9d80eee |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
11471:994e2a93a8e2 | 11472:1740012184f9 |
---|---|
48 if ((nargin < 2) || (nargin > 3)) | 48 if ((nargin < 2) || (nargin > 3)) |
49 print_usage (); | 49 print_usage (); |
50 endif | 50 endif |
51 | 51 |
52 if (! (isvector (x) && isvector (y) && (length (x) == length (y)))) | 52 if (! (isvector (x) && isvector (y) && (length (x) == length (y)))) |
53 error ("sign_test: x and y must be vectors of the same length"); | 53 error ("sign_test: X and Y must be vectors of the same length"); |
54 endif | 54 endif |
55 | 55 |
56 n = length (x); | 56 n = length (x); |
57 x = reshape (x, 1, n); | 57 x = reshape (x, 1, n); |
58 y = reshape (y, 1, n); | 58 y = reshape (y, 1, n); |
63 if (nargin == 2) | 63 if (nargin == 2) |
64 alt = "!="; | 64 alt = "!="; |
65 endif | 65 endif |
66 | 66 |
67 if (! ischar (alt)) | 67 if (! ischar (alt)) |
68 error ("sign_test: alt must be a string"); | 68 error ("sign_test: ALT must be a string"); |
69 endif | 69 endif |
70 if (strcmp (alt, "!=") || strcmp (alt, "<>")) | 70 if (strcmp (alt, "!=") || strcmp (alt, "<>")) |
71 pval = 2 * min (cdf, 1 - cdf); | 71 pval = 2 * min (cdf, 1 - cdf); |
72 elseif strcmp (alt, ">") | 72 elseif strcmp (alt, ">") |
73 pval = 1 - cdf; | 73 pval = 1 - cdf; |