Mercurial > hg > octave-lyh
changeset 13059:107651f79e06
codesprint: 9 tests for hamming.m
author | Andriy Shinkarchuck <adriano32.gnu@gmail.com> |
---|---|
date | Sat, 03 Sep 2011 12:40:21 -0500 |
parents | 14422cc782b2 |
children | 85dd509673e7 |
files | scripts/signal/hamming.m |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/signal/hamming.m +++ b/scripts/signal/hamming.m @@ -45,3 +45,17 @@ endif endfunction + +%!assert (hamming (1), 1); +%!assert (hamming (2), (0.54 - 0.46)*ones(2,1)); +%!assert (hamming (16), fliplr (hamming (16))); +%!assert (hamming (15), fliplr (hamming (15))); +%!test +%! N = 15; +%! A = hamming (N); +%! assert (A (ceil (N/2)), 1); + +%!error hamming (); +%!error hamming (0.5); +%!error hamming (-1); +%!error hamming (ones(1,4));