Path: news.mathworks.com!not-for-mail
From: Loren Shure <loren@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Greatest commmon divisor
Date: Tue, 16 Dec 2008 10:16:09 -0500
Organization: The MathWorks
Lines: 26
Message-ID: <MPG.23b190401148d6f989909@news.mathworks.com>
References: <ghukju$ksu$1@fred.mathworks.com> <ghul2u$rfp$1@fred.mathworks.com> <ghum4l$d95$1@fred.mathworks.com> <gi7mqt$87b$1@fred.mathworks.com> <gi7o45$297$1@fred.mathworks.com> <gi7uei$22l$1@fred.mathworks.com>
NNTP-Posting-Host: vpn-client-122-19-ah.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1229440567 25244 144.212.122.19 (16 Dec 2008 15:16:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 16 Dec 2008 15:16:07 +0000 (UTC)
User-Agent: MicroPlanet-Gravity/2.70.2067
Xref: news.mathworks.com comp.soft-sys.matlab:507315


In article <gi7uei$22l$1@fred.mathworks.com>, #10584@fileexchange.com 
says...
> "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gi7o45$297$1@fred.mathworks.com>...
> > "Jos " <#10584@fileexchange.com> wrote in message <gi7mqt$87b$1@fred.mathworks.com>...
> > > What about
> > > 
> > > min(gcd(A(1:end-1),A(2:end)))
> > > 
> > > Jos
> > 
> >   I don't think that would work, Jos, even with zeros eliminated.  Let A = [15,21,35].  Then gcd(A(1:end-1),A(2:end)) would yield [3,7] but the minimum of these is not the gcd of the three combined quantities.  The greatest common factor of all three is simply 1, not this minimum.
> > 
> > Roger Stafford
> 
> Yep, you and Bruno are right, of course. I was just wondering why Loren suggested arrayfun, and so I was looking for a function that could do this. 
> 
> Jos
> 
> 

Perhaps I misread the problem.  I thought the OP wanted GCD of each 
"pair" of points in 2 arrays.  Probably read too fast...

-- 
Loren
http://blogs.mathworks.com/loren