MATLAB: How to differentiate between integer and floating point numbers in a double array

datatypedoublefloatimporting excel dataintMATLABnumericxlsread

My requirement is to import data from Excel which has both integer and floating point numbers. For example, 1 and 2.5 I want to differentiate between them. But the Excel import coverts all numeric data into 'double' which is floating point by default.
Any help in this regard is appreciated! Thanks!

Best Answer

is_integer = your_data == floor(your_data);