Path: news.mathworks.com!not-for-mail From: "Sean " <sean.dewolski@nospamplease.umit.maine.edu> 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$1@fred.mathworks.com> References: <ib1crc$6ep$1@fred.mathworks.com> <ib1dv0$jns$1@fred.mathworks.com> <ib1elh$5nk$1@fred.mathworks.com> Reply-To: "Sean " <sean.dewolski@nospamplease.umit.maine.edu> NNTP-Posting-Host: webapp-02-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1288978504 15200 172.30.248.37 (5 Nov 2010 17:35:04 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Fri, 5 Nov 2010 17:35:04 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2256903 Xref: news.mathworks.com comp.soft-sys.matlab:684223 "Hugh " <h_a_patience@hotmail.com> wrote in message <ib1elh$5nk$1@fred.mathworks.com>... > "Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <ib1dv0$jns$1@fred.mathworks.com>... > > > > > > > > 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 which 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)])