From: "Steven_Lord" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: if else - odd -even in Matlab
Date: Thu, 10 Mar 2011 13:04:55 -0500
Organization: MathWorks
Lines: 37
Message-ID: <ilb3rh$1g3$>
References: <g7qesi$8nl$> <ilapb1$nic$>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
X-Trace: 1299780273 1539 (10 Mar 2011 18:04:33 GMT)
NNTP-Posting-Date: Thu, 10 Mar 2011 18:04:33 +0000 (UTC)
In-Reply-To: <ilapb1$nic$>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: comp.soft-sys.matlab:715087

"james " <> wrote in message 
> a dead thread without an answer
> x = uint8(1);
> x= a number of your choice
> test=x/2;
> decide=isinteger(test);

ISINTEGER probably doesn't do what you think it does.

It determines if the input is of an integer _data type_, not if the value is 
an integer _value_.

isinteger(double(5)) % false since double is not an integer data type

Take a look at:

x = uint8(5);
test = x/2;
isinteger(test) % true because the result of dividing a uint8 by a double 
scalar is of class uint8

Steve Lord
To contact Technical Support use the Contact Us link on