Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Better way to read data
Date: Tue, 17 Jun 2008 22:00:17 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 23
Message-ID: <g39c5g$scl$1@fred.mathworks.com>
References: <g39b02$gls$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1213740017 29077 172.30.248.35 (17 Jun 2008 22:00:17 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 17 Jun 2008 22:00:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:474356



"Pete sherer":
<SNIP wants to read his/her cells...

one of the many solutions

% the data
     c={
          '1,2,3'
          '10,20,30,40'
          '-1,-2'
     };
% the engine
     opt={'delimiter',','};
     r=cellfun(@(x) strread(x,'%n',opt{:}).',c,'uni',false)
% the result
     r{:}
%{
     ans = 1 2 3
     ans = 10 20 30 40
     ans = -1 -2
%}

us