comparison scripts/statistics/base/cor.m @ 12557:4715ce9f911d

cor.m: Increase tolerance of %!tests using random data to assure passage.
author Rik <octave@nomad.inbox5.com>
date Thu, 31 Mar 2011 10:09:34 -0700
parents 422a7a7e9b6e
children 6b2f14af2360
comparison
equal deleted inserted replaced
12556:88558b8eb8a7 12557:4715ce9f911d
35 35
36 endfunction 36 endfunction
37 37
38 %!test 38 %!test
39 %! x = rand (10, 2); 39 %! x = rand (10, 2);
40 %! assert (isequal (cor (x), corrcoef (x))); 40 %! assert (cor (x), corrcoef (x), 5*eps);
41 %! assert (cor (x(:,1), x(:,2)) == corrcoef (x(:,1), x(:,2))); 41 %! assert (cor (x(:,1), x(:,2)) == corrcoef (x(:,1), x(:,2)));
42 42
43 %% Test input validation 43 %% Test input validation
44 %!error corrcoef (); 44 %!error corrcoef ();
45 %!error corrcoef (1, 2, 3); 45 %!error corrcoef (1, 2, 3);