Path: news.mathworks.com!not-for-mail
From: "Steven_Lord" <slord@mathworks.com>
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$1@fred.mathworks.com>
References: <g7qesi$8nl$1@fred.mathworks.com> <ilapb1$nic$1@fred.mathworks.com>
NNTP-Posting-Host: ah-slord.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="UTF-8";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1299780273 1539 172.31.44.225 (10 Mar 2011 18:04:33 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 10 Mar 2011 18:04:33 +0000 (UTC)
In-Reply-To: <ilapb1$nic$1@fred.mathworks.com>
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: news.mathworks.com comp.soft-sys.matlab:715087



"james " <james.franklin.uk@googlemail.com> wrote in message 
news:ilapb1$nic$1@fred.mathworks.com...
>
> 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.

http://www.mathworks.com/help/techdoc/ref/isinteger.html

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
slord@mathworks.com
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com