bitand(NaN,1) causes error

조회 수: 2 (최근 30일)
Norton Allen
Norton Allen 2013년 4월 14일
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?

답변 (1개)

Dennis J
Dennis J 2013년 7월 24일
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.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by