Hi,
since
isinteger(int8(5))
is true, I would expect
function c = minimalExample(a)p = inputParser;addRequired(p,'a',@(x)validateattributes(x,{'integer'}, {'positive'}));parse(p,a)c = a;end
to return
ans = int8 5.
when calling minimalExample(int8(5)). But it does not. It returns:
The value of 'a' is invalid. Expected input to be one of these types:
integer
Instead its type was int8.
However
function c = minimalExample(a)p = inputParser;addRequired(p,'a',@(x)validateattributes(x,{'int8','int16', 'int32', 'int64', 'uint8','uint16', 'uint32', 'uint64'}, {'positive'}));parse(p,a)c = a;end
when calling minimalExample(int8(5)) works fine. What in the name of Knuth is an 'integer' type? Thanks in advance :).
Best Answer