Path: news.mathworks.com!not-for-mail
From: "Devdatt Lad" <dlad@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Get one dimension of a cell array
Date: Mon, 2 Jun 2008 09:55:34 -0400
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <g20u4o$9va$1@fred.mathworks.com>
References: <g20t01$qg8$1@fred.mathworks.com>
Reply-To: "Devdatt Lad" <dlad@mathworks.com>
NNTP-Posting-Host: ladd.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1212414936 10218 144.212.111.18 (2 Jun 2008 13:55:36 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 2 Jun 2008 13:55:36 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
Xref: news.mathworks.com comp.soft-sys.matlab:471774



"David Doria" wrote...
>I have this
>
> A{dim1, dim2, dim3};
>
> I want to do:
>
> B = A{1,1,:}; %make B a 1D cell array containing all the
> items in A with first index 1 and second index 1.
>
> What happens though is just A{1,1,1} is assigned to B.  Is
> there a way to do this?

B = squeeze(A(1,1,:))

-- 
Devdatt Lad
The MathWorks, Inc.