Path: news.mathworks.com!not-for-mail
From: "Phil Goddard" <philgoddardNOSPAM@telus.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: problem in reading comma delimited data array
Date: Mon, 5 Jan 2009 00:34:02 +0000 (UTC)
Organization: Goddard Consulting
Lines: 9
Message-ID: <gjrkhq$m8k$1@fred.mathworks.com>
References: <cfb037ff-f11b-4d59-b97d-261e9a0a84bc@n33g2000pri.googlegroups.com>
Reply-To: "Phil Goddard" <philgoddardNOSPAM@telus.net>
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 1231115642 22804 172.30.248.35 (5 Jan 2009 00:34:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 Jan 2009 00:34:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 26433
Xref: news.mathworks.com comp.soft-sys.matlab:509787



One possibility:

data = fileread('nameOfMyDataFile.txt');
data(data==char(10)) = []; %get rid of newline characters
data(data==char(13)) = []; %get rid of carriage returns
data = str2num(data)'; % convert to a column of numeric data

Phil.