Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: vectorise a reshape loop
Date: Mon, 21 Jul 2008 14:59:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <g6287m$bkb$1@fred.mathworks.com>
References: <g5krk2$77v$1@fred.mathworks.com> <muyd4l78h3a.fsf@G99-Boettcher.llan.ll.mit.edu>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216652342 11915 172.30.248.37 (21 Jul 2008 14:59:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 21 Jul 2008 14:59:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1338633
Xref: news.mathworks.com comp.soft-sys.matlab:480677



> The size of the left side IS NOT 2x2x90x1. q is a scalar,
> so the left side is 2x2x1x1. The right side, I assume, is
> 2x2x1x16. But don't guess or believe me. If you can't 
> figure out your dimension issues, I meant what I said 
> about "if you're not sure, assign it to a variable and 
> ask MATLAB to tell you what the size is".
> tmp = ndfun('mprod', M(:,:,q,:));
> size(tmp)

I am getting quite confused with what I thought would be a
simple thing. prodH and M are contained within a loop of 90
iterations, so the size of the resulting prodH matrix after
running the loop should be 2x2x90x1.

M is of the size 2x2x90x16 and i am iterating through this
using a loop to find the product of the 4th dimension
(length 16) for each of the indices in the 3rd dimension
(length 90). 

This would then result in prodH of the size 2x2x90x1 with
each 2x2 matrix being the product of the 16 in M.

I hope that makes sense. That is what I am trying to achieve
and thought that ndfun('mprod') would be enable that. If my
loop is confusing and seems to suggest something different
then apologies.

Please could you show me how to write this correctly as I am
starting to go mad with it? Thanks.