Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!news.aset.psu.edu!support1.mathforum.org!not-for-mail
From: Clem <c_vezier@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: character matrix
Date: Thu, 15 May 2008 17:11:40 EDT
Organization: The Math Forum
Lines: 30
Message-ID: <28364413.1210885931460.JavaMail.jakarta@nitrogen.mathforum.org>
NNTP-Posting-Host: nitrogen.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1210885931 22425 144.118.30.135 (15 May 2008 21:12:11 GMT)
X-Complaints-To: news@support1.mathforum.org
NNTP-Posting-Date: Thu, 15 May 2008 21:12:11 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:468707


Hello everyboby

I would like to generate a matrix of characters. (see below)

S0 = ['ascii_plans_x_1600.dat',
'ascii_plans_x_1800.dat',
'ascii_plans_x_2000.dat',
'ascii_plans_x_2200.dat',
'ascii_plans_x_2400.dat',
'ascii_plans_x_2600.dat',
'ascii_plans_x_2800.dat',
'ascii_plans_x_3000.dat',
'ascii_plans_x_3200.dat',
'ascii_plans_x_3400.dat'];

I am able to generate the name of the file automatically by the following command (each time, the value 1600 is replaced by the value given to 'i')

s = 'ascii_plans_x_1600.dat';
s1 = '1600';
for i=1600:100:4800
    
    s2 =  num2str(i);
    X= strrep(s, s1, s2)
end

but I am not able to put them in a matrix. I have the result line by line, I can not link them together.

If someone has an idea, I would really appreciate.

Clementine