Path: news.mathworks.com!not-for-mail
From: "James Carter" <jimctr@msn.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Basic Matlab Question
Date: Tue, 17 Nov 2009 00:20:19 +0000 (UTC)
Organization: Leupold &#38; Stevens Inc
Lines: 24
Message-ID: <hdsq83$hf$1@fred.mathworks.com>
References: <hdso7p$sh5$1@fred.mathworks.com> <hdsp40$mg5$1@fred.mathworks.com>
Reply-To: "James Carter" <jimctr@msn.com>
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 1258417219 559 172.30.248.35 (17 Nov 2009 00:20:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 17 Nov 2009 00:20:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 453088
Xref: news.mathworks.com comp.soft-sys.matlab:585624


"Matt Fetterman" <mattinjersey@yahoo.com> wrote in message <hdsp40$mg5$1@fred.mathworks.com>...
> "James Carter" <jimctr@msn.com> wrote in message <hdso7p$sh5$1@fred.mathworks.com>...
> > I have a 32 x 1300 2D array, lets call it S.  I know I can pick off a particular row with the following argument: A = S(1,:); which gives me a 1 x 1300 array from the first 
> > row of the 2D array.  I want every row assigned to a new indexed array, so I would start off with
> > 
> > for n = 1:rows
> > A(n) = S(n,:);
> > end
> > 
> > This doesn't work because of a dimensional mismatch.   I'm not really trying to define
> > a dimension but simply declare a unique identifier.   How am I able to assign rows 
> > such that I can put them in A(1), A(2), etc., all with the dimension 1 x 1300.  
> > 
> > Thanks!

When I attempt your suggestion using the Cell Array A{n} I get the following error

??? Cell contents assignment to a non-cell array object.

> 
> How about a cell array:
>  for n = 1:rows
>  A{n} = S(n,:);
>  end