MATLAB Answers

2

bitand(NaN,1) causes error

Asked by Norton Allen on 14 Apr 2013
This is in R2011a, but possibly obscure enough to have persisted. bitand() appears to tolerate NaNs in the input unless the NaN appears as the last element of the input vector.
>> bitand([0 1 NaN],1)
??? Error using ==> bitand
Exceeded value of bitmax.
>> bitand([0 1 NaN 0 1],1)
ans =
0 1 NaN 0 1
Has this been fixed in later versions?

  0 Comments

Sign in to comment.

Products

1 Answers

Answer by Dennis J
on 24 Jul 2013

Yes it has been fixed, now NaN is no longer accepted as input:
bitand([0 1 NaN 0 1],1)
will give
Error using bitand
Double inputs must have integer values in the range of ASSUMEDTYPE.

  0 Comments

Sign in to comment.



Translated by