Path: news.mathworks.com!not-for-mail
From: "burcu " <burcu102@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: reading alphanumeric data
Date: Wed, 4 Nov 2009 11:15:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 34
Message-ID: <hcrnnp$2jj$1@fred.mathworks.com>
References: <hb6otr$oq4$1@fred.mathworks.com> <hb9c01$32e$1@fred.mathworks.com> <hbn2eo$p1$1@fred.mathworks.com> <hbp3cn$n2i$1@fred.mathworks.com> <hbs8m5$86$1@fred.mathworks.com> <hbsa1m$rbd$1@fred.mathworks.com> <hbsbcr$omg$1@fred.mathworks.com> <hc3k9d$6ha$1@fred.mathworks.com> <hc9kdi$a3m$1@fred.mathworks.com> <hcbg29$3td$1@fred.mathworks.com> <hcrk3f$l2p$1@fred.mathworks.com> <hcrlth$qc0$1@fred.mathworks.com>
Reply-To: "burcu " <burcu102@hotmail.com>
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 1257333305 2675 172.30.248.35 (4 Nov 2009 11:15:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Nov 2009 11:15:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1870888
Xref: news.mathworks.com comp.soft-sys.matlab:582321


> > Hi Branko,
> > 
> > I've upgraded my matlab from 2006 to r2009b and tried again your codes and i'm exactly facing with the same error. May i kindly ask you to check my code and comment if i do something wrong?
> > (Data is the one that has 40 columns, i saved into a notepad)
> > 
> > >> fid=fopen ('data.txt');
> > >> data=textscan(fid, '%s', 'delimiter',',');
> > >> fclose(fid);
> > >> data =cat(1,data{:});
> > >> String_data=regexp(data,'([A-Z a-z]+)','match');
> > >> Numeric_data=regexp(data,'([0.00-9.99]+)','match');
> > >> Numeric_data=cat(1,Numeric_data{:});
> > >> String_data=cat(1,String_data{:});
> > ??? Error using ==> cat
> > CAT arguments dimensions are not consistent.
> > 
> > > 
> > > 

> 
> Burcu,
> 
> Simple reason why, cat error is comming up. When you copy example into ascii file DON'T copy data={ }-which is name of the cell array. I used this just to show that is regexp is working on different length of data.
> 
> Branko

Branko,

Sorry but i couldn't get what you mean with don't copy  data={ }.
I've been checking the usage of cat not to ask unnecessary questions and  data =cat(1,data{:}); seemd a required step to me. and if i skip this code and enter String_data=regexp(data,'([A-Z a-z]+)','match'); after fclose(fid); i get the error All cells for regexp must be strings.

Thanks for your support
Burcu