Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Combine variable length vectors into one vector
Date: Sat, 18 Aug 2012 06:30:16 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 22
Message-ID: <k0ncpo$qsj$1@newscl01ah.mathworks.com>
References: <k0c1vj$2h3$1@newscl01ah.mathworks.com> <k0m9qa$53f$1@newscl01ah.mathworks.com> <k0md74$h2f$1@newscl01ah.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-06-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1345271416 27539 172.30.248.38 (18 Aug 2012 06:30:16 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 18 Aug 2012 06:30:16 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:776717

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message 
> % You can even loop many times dir(), like this
> c = cell(1,26);
> for k=1:26
>     alphabet='a'+(k-1);
>     s = dir([alphabet '*.m']);
>     c{k} = {s.name};
> end
> c = flattencell(c) % use the bellow mfile
> 

or growing the cell

filenames = {};
for k=1:26
    alphabet='a'+(k-1);
    s = dir([alphabet '*.m']);
    filenames  = [filenames  {s.name}];
end
filenames 

% Bruno