From: (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: if else - odd -even in Matlab
Date: Mon, 11 Aug 2008 23:10:27 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 21
Message-ID: <g7qgt3$hls$>
References: <g7qesi$8nl$>
X-Trace: 1218496227 18108 (11 Aug 2008 23:10:27 GMT)
NNTP-Posting-Date: Mon, 11 Aug 2008 23:10:27 +0000 (UTC)
Originator: (Walter Roberson)
Xref: comp.soft-sys.matlab:484989

In article <g7qesi$8nl$>,
Marie Hadji <> wrote:

>Can anybody guide me how to do this right in matlab.
>Actually How I can distinguish odd from even from numbers (0
>to 8 with if and else)?

>ex. if x==1 or x==3 or x==5 or x==7 do that else if x==0 or
>x==2 or x==4 or x==6 or x==8 do that.

first = @(v) v(1);
if first(factor(x)) - 2
  "I will speculate that [...] applications [...] could actually see a
  performance boost for most users by going dual-core [...] because it
  is running the adware and spyware that [...] are otherwise slowing
  down the single CPU that user has today"           -- Herb Sutter