--- a/inst/pamdemod.m
+++ b/inst/pamdemod.m
@@ -68,3 +68,8 @@
 
 %!assert (pamdemod ([-7:2:7], 8, 0, "Bin"), [0:7])
 %!assert (pamdemod ([-7:2:7], 8, 0, "Gray"), [0 1 3 2 6 7 5 4])
+
+%% Test input validation
+%!error pamdemod ()
+%!error pamdemod (1)
+%!error pamdemod (1, 2, 3, "invalid")