Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: vectorise a reshape loop
Date: Thu, 17 Jul 2008 14:12:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <g5njvm$14r$1@fred.mathworks.com>
References: <g5krk2$77v$1@fred.mathworks.com> <g5kthu$svb$1@fred.mathworks.com> <g5n4kd$jtp$1@fred.mathworks.com> <g5n9fu$6vv$1@fred.mathworks.com> <g5ngf2$fdp$1@fred.mathworks.com> <g5nj77$j6j$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216303926 1179 172.30.248.35 (17 Jul 2008 14:12:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 17 Jul 2008 14:12:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1338633
Xref: news.mathworks.com comp.soft-sys.matlab:479986



> Its not my ndfun.

sorry, not sure why i suggested it was yours. it is from
http://www.mit.edu/~pwb/matlab/ndfun/ndfun.m

 
> What would be the result of this product?
> Perhaps just a 2x2 array? How do you
> expect a 2x2 array to fit into a single
> array element of prodH? Why would you
> index the result as prodH(1,q) ?
> 
> If that result is a 2x2 array, and you have
> preallocated prodH as 2x2x3, then should
> you not do it as
> 
>    prodH(:,:,q)=ndfun('mprod',M(:,:,p,:));

after i had posted that i realised it was wrong and my line
in the for loop now looks like:
prodH(:,:,q)=ndfun('mprod',M(:,:,q,:))

however, i still get the same error. i am expecting 3 2x2
arrays, 1 for each product of the 16 arrays.