From: "Sean " <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matrix multiplication woes
Date: Fri, 5 Nov 2010 17:35:04 +0000 (UTC)
Organization: University of Maine
Lines: 30
Message-ID: <ib1f88$er0$>
References: <ib1crc$6ep$> <ib1dv0$jns$> <ib1elh$5nk$>
Reply-To: "Sean " <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1288978504 15200 (5 Nov 2010 17:35:04 GMT)
NNTP-Posting-Date: Fri, 5 Nov 2010 17:35:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2256903
Xref: comp.soft-sys.matlab:684223

"Hugh " <> wrote in message <ib1elh$5nk$>...
> "Sean " <> wrote in message <ib1dv0$jns$>...
> > 
> > > 
> > > The line Layers(tpast,:,:)=payoff'*ones(1,Nnu+1);
> > > 
> > 
> > Put a break point at this line and save.  Then call the function, if the debugger does not stop at this line, you have a file path issue.  If it does (which it should we hope), type:
> > whos
> > at the command line and it'll tell you the sizes.  If it's not obvious then, report the error message and all of the sizes back here.
> tnx Sean.
> I changed the name of the finction then changed the name of the file to match using saveAs would this give me the file path issue you mention?
> Also to be clear in the problem 
> > > The line Layers(tpast,:,:)=payoff'*ones(1,Nnu+1);
> the rhs works when I assign it to a new veriable say A, however I can not get it to assigmto Layers but I think it should. Will become clearer I suppose when this filepath issue is resolved.

I don't know about the file path issue.  You can type
at the command line to see where it thinks it is.

As for the RHS working when not assigning this makes perfect sense actually.
You are trying to assign a 2-d matrix (has to be scalar, vector or full 2d since this is all mtimes works for) to a 3d slice.

You'll need to PERMUTE or RESHAPE it to get it to fit.  Something like:
reshape(rhs,[1 size(rhs,1),size(rhs,2)])