|
"Matt J" wrote in message <k039jp$psu$1@newscl01ah.mathworks.com>...
> "Tom Sutherland" wrote in message <k032s5$11j$1@newscl01ah.mathworks.com>...
> > I want to take each element of a MxN matrix and add it to a group(TxV) of elements of another matrix that is MxTxNxV. So a single element of MN gets added to a group of elements of the MTNV matrix.
> > Is there a faster method to do this besides doing 'for' loops?
> > Example:
> > % Long Version
> > for n=1:N
> > for m=1:M
> > for t=1:T-1
> > for v=1:V-1
> > TV(n*t+t-1, m*v+v-1) = MN(n,m) + TV(n*t+t-1, m*v+v-1);
> =================
>
>
> Is this what you want:
>
> TV=TV+kron(MN, ones(T,V));
Yes, That looks like it does close to what I want. Thanks!!!
|