Mercurial > hg > octave-lyh
comparison scripts/signal/bartlett.m @ 13062:b3a8b75dfec3
codesprint: 9 tests for bartlett.m
author | Andriy Shinkarchuck <adriano32.gnu@gmail.com> |
---|---|
date | Sat, 03 Sep 2011 13:12:50 -0500 |
parents | fd0a3ac60b0e |
children | 984359717d71 |
comparison
equal
deleted
inserted
replaced
13061:addfc0ae69c0 | 13062:b3a8b75dfec3 |
---|---|
45 n = fix (m / 2); | 45 n = fix (m / 2); |
46 c = [2*(0:n)/m, 2-2*(n+1:m)/m]'; | 46 c = [2*(0:n)/m, 2-2*(n+1:m)/m]'; |
47 endif | 47 endif |
48 | 48 |
49 endfunction | 49 endfunction |
50 | |
51 %!assert (bartlett (1), 1); | |
52 %!assert (bartlett (2), zeros (2,1)); | |
53 %!assert (bartlett (16), fliplr (bartlett (16))); | |
54 %!assert (bartlett (15), fliplr (bartlett (15))); | |
55 %!test | |
56 %! N = 9; | |
57 %! A = bartlett (N); | |
58 %! assert (A (ceil (N/2)), 1); | |
59 | |
60 %!error bartlett (); | |
61 %!error bartlett (0.5); | |
62 %!error bartlett (-1); | |
63 %!error bartlett (ones(1,4)); |