Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Basic Matlab Question
Date: Tue, 17 Nov 2009 00:04:03 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 8
Message-ID: <hdsp9j$3hj$1@fred.mathworks.com>
References: <hdso7p$sh5$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1258416243 3635 172.30.248.38 (17 Nov 2009 00:04:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 17 Nov 2009 00:04:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:585620


Use a cell array instead.
A{n} = S(n,:)

or easier:


A = [magic(3),magic(3)]
B = mat2cell(A,ones(1,size(A,1)),size(A,2))