Mercurial > hg > octave-lyh
changeset 13055:4e95529cbc51
codesprint: 9 tests for hanning.m
author | Andriy Shinkarchuck <adriano32.gnu@gmail.com> |
---|---|
date | Sat, 03 Sep 2011 12:23:35 -0500 |
parents | 63d06af0376a |
children | 66662c033301 |
files | scripts/signal/hanning.m |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/signal/hanning.m +++ b/scripts/signal/hanning.m @@ -45,3 +45,17 @@ endif endfunction + +%!assert (hanning (1), 1); +%!assert (hanning (2), zeros(2,1)); +%!assert (hanning (16), fliplr (hanning (16))); +%!assert (hanning (15), fliplr (hanning (15))); +%!test +%! N = 15; +%! A = hanning (N); +%! assert (A (ceil (N/2)), 1); + +%!error hanning (); +%!error hanning (0.5); +%!error hanning (-1); +%!error hanning (ones(1,4));