Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Contracting Matrices
Date: Sun, 28 Dec 2008 22:35:24 -0500
Organization: The MathWorks, Inc.
Lines: 27
Message-ID: <gj9ghs$dqk$1@fred.mathworks.com>
References: <gj5ksv$1mq$1@fred.mathworks.com> <gj5o9m$n2n$1@fred.mathworks.com> <gj5tat$jb2$1@fred.mathworks.com> <gj65bp$dhc$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1230521724 14164 144.212.105.187 (29 Dec 2008 03:35:24 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Dec 2008 03:35:24 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:509005


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in 
message news:gj65bp$dhc$1@fred.mathworks.com...
> "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]

Since SIZE drops trailing singleton dimensions, size(temp) should be [4 4 
16].  Similarly, for the lines below, the trailing 1 is dropped.

*snip*

-- 
Steve Lord
slord@mathworks.com