Is it an integer value?
Show older comments
1.7008e+05. IS this value considers as an integer in matlab.I found such values and when performing bitxor operation there occurs some error. So i doubted whether those value are the problem. Please help me with this.
Accepted Answer
More Answers (1)
Steven Lord
on 6 Apr 2018
The isinteger function checks if the class of the value is one of the eight integer types, not if the value is an integer value.
>> isinteger(1)
ans =
logical
0
The number 1 is stored by default in MATLAB as a double, so that's correct.
One way of checking the value is to use round.
>> A = [1 pi 5.5 17 -3];
>> A == round(A)
ans =
1×5 logical array
1 0 0 1 1
1 Comment
Sneha P S
on 11 Apr 2018
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!