From: Susan on
"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <huu31g$qmk$1(a)fred.mathworks.com>...
> "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <huu2o4$8if$1(a)fred.mathworks.com>...
>
> > You probably need to use kron()
> >
> > So, for example, if X is an MxN matrix and x=X(:), then
> >
> > Br=eye(M)*X*ones(1,N).'; % row-wise sum
> > Bc= ones(1,M)*X*eye(N).'; %column-wise sum
> >
> > are the row-wise sum and column-wise sum respectively, they are related to x as follows
> >
> > Br(:)=kron(ones(1,N),eye(M)) * x
> > Bc(:)=kron(eye(N), ones(1,M)) * x
> =========
>
> In case the above was unfamiliar to you, the more general relationship is as follows. If
>
> Y=P*X*Q.' ;
>
> then
>
> Y(:)=kron(Q,P)*X(:) ;

Hi Matt;
This is unfamiliar but makes logical sense. Thanks for your help!