Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Contracting Matrices
Date: Sat, 27 Dec 2008 21:06:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <gj65bp$dhc$1@fred.mathworks.com>
References: <gj5ksv$1mq$1@fred.mathworks.com> <gj5o9m$n2n$1@fred.mathworks.com> <gj5tat$jb2$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 1230411961 13868 172.30.248.35 (27 Dec 2008 21:06:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 27 Dec 2008 21:06:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:508917


"Philosophaie" <ertlejack@sbcglobal.net> wrote in message <gj5tat$jb2$1@fred.mathworks.com>...
> >  temp = reshape(Riemann,4,4,[],1);
> >  Ricci = squeeze(sum(temp(:,:,1:4+1:4*4,1),3));
> >  disp(Ricci(:,:))
> this produces a 1x4 matrix
> What am I doing wrong?

  I would suggest doing the 'size' operator at each stage.  You should get these results:

 size(Riemann) --> [4 4 4 4]
 size(temp) --> [4 4 16 1]
 size(temp(:,:,1:4+1:4*4,1)) --> [4 4 4 1]
 size(sum(temp(:,:,1:4+1:4*4,1),3)) --> [4 4 1 1]
 size(Ricci) --> [4 4]

Where does yours differ from this?

Roger Stafford