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 09:17:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 48
Message-ID: <g61k6f$1gj$1@fred.mathworks.com>
References: <g5krk2$77v$1@fred.mathworks.com> <muy8ww0bjwd.fsf@G99-Boettcher.llan.ll.mit.edu>
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 1216631823 1555 172.30.248.35 (21 Jul 2008 09:17:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 21 Jul 2008 09:17:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1338633
Xref: news.mathworks.com comp.soft-sys.matlab:480630



> figure out the dimensions of the right-hand side.  Try it
first
> mentally, and if you're not sure, assign it to a variable
and ask MATLAB
> to tell you what the size is.
> 
> Then, look at where you want to assign it.  Your
assignment indices
> must provide a place in the output which exactly matches
the dimensions
> of the right side.
> 
> For instance, I can't say:
> 
> A(1, 2:4) = B(1:4, 2);
> 
> Why?
> left side is 1x3, right side is 4x1
> 
> I can't say:
> A(1,1,2:4) = B(1,2:4)
> 
> Why?
> left side is 1x1x3, right side is 1x3
> 
> -Peter


ok, the size of my right side is 2x2x90x16 and the required
size for my left is 2x2x90x1 so I have written this as:

prodH=zeros(2,2,length(freq),1);
for p=1:length(freq)
    q=p;
    prodH(:,:,q,1)=ndfun('mprod',M(:,:,q,:))
end

I still get:

??? Assignment has more non-singleton rhs dimensions than
non-singleton
subscripts

Error in ==> new_for_gatool_2 at 110
        prodH(:,:,q,1)=ndfun('mprod',M(:,:,q,:))

What am i still doing wrong? Thanks for your help.