Change to narginchk.

Updating the check for number of inputs, as the previous method is to
be discontinued in future versions of Matlab.