Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: conv2(..) fault ???
Date: Mon, 12 Mar 2012 19:15:13 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <jjli01$dg0$1@newscl01ah.mathworks.com>
References: <jjk5d7$ecs$1@newscl01ah.mathworks.com> <jjk8id$nbh$1@newscl01ah.mathworks.com> <jjkav6$18b$1@newscl01ah.mathworks.com> <jjkdt0$9f0$1@newscl01ah.mathworks.com> <jjkvdk$4vg$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1331579713 13824 172.30.248.37 (12 Mar 2012 19:15:13 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 12 Mar 2012 19:15:13 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:760720

"Le Tuan" wrote in message <jjkvdk$4vg$1@newscl01ah.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jjkdt0$9f0$1@newscl01ah.mathworks.com>...
> > "Le Tuan" wrote in message <jjkav6$18b$1@newscl01ah.mathworks.com>...
> > > "Roger Stafford" wrote in message <jjk8id$nbh$1@newscl01ah.mathworks.com>...
> > 
> > > I don't understand.
> > > According to:
> > > http://docs.gimp.org/en/plug-in-convmatrix.html
> > > I think c(1,1)=(-5)*(-1)+5*(-1)+0*(-1)+5*0+5*0+0*0+0*1+5*1+0*1=5
> > 
> > This doc is not Matwork, conv() flips the second array before multiplication and summming.
> > 
> > Read mathworks doc instead.
> > 
> > Bruno
> 
> Please, excuse me. What mean of your "flip" ? Can you give me an example ?
> Sorry because my English is very bad !
- - - - - - - -
  What Bruno means by "flip" is what the matlab 'flipud' and 'fliplr' functions do.  Look at this example:

 a = [1,2;3,4]; b = [11,12;13,14];
 c = conv2(a,b,'valid');

The result is c = 1*14+2*13+3*12+4*11 = 120.

  It's the same as doing sum(sum(a.*flipud(fliplr(b)))).  Read the Mathworks documentation for 'conv2' carefully.

Roger Stafford