MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

ListCorrelate[] ??

  • To: mathgroup at
  • Subject: [mg30104] ListCorrelate[] ??
  • From: Brent Pedersen <bpederse at>
  • Date: Sat, 28 Jul 2001 01:51:04 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

with a real square matrix H, I calculate the sum of each cell and its 8
neighbors as:
Htot=ListCorrelate[kern, H ,{2,-2}];     (thanks to the help of some of
kern = Table[1, {3}, {3}];

now, for each 9 cell neighborhood around (and including cell H[[i,j]], I
wish to calculate:
(when c=1, this will be 1.)
of course, this code won't work as is but the idea is there.I can write
loops containing a Sum[] similar to that above,but i am sure that
ListCorrelate[] operates much faster (which is important since H is
256*256).in short, i need to output a 256*256 matrix where each cell
contains the result of the Sum[] function above.

ListCorrelate[kern, H/Htot,{2,-2}]; does not work because it contains
H[[i,j]]/Htot[[i,j]]  not H[[i,j]]/Htot[[m,n]];

will some variation of
ListCorrelate[H, 1/Htot, {n,-n}]; work?
as yet, no luck with that.
any ideas will be greatly appreciated.

  • Prev by Date: Re: commands history in notebook
  • Next by Date: RE: commands history in notebook
  • Previous by thread: Re: Nested Trigonometry Functions
  • Next by thread: Re: ListCorrelate[] ??