Path: news.mathworks.com!not-for-mail
From: "Barry Williams" <barry.r.williamsnospam@saic.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: about textread
Date: Thu, 17 Apr 2008 12:51:03 +0000 (UTC)
Organization: SAIC
Lines: 48
Message-ID: <fu7h3n$5ol$1@fred.mathworks.com>
References: <fu4tt6$rjq$1@fred.mathworks.com>
Reply-To: "Barry Williams" <barry.r.williamsnospam@saic.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1208436663 5909 172.30.248.37 (17 Apr 2008 12:51:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 17 Apr 2008 12:51:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 804417
Xref: news.mathworks.com comp.soft-sys.matlab:463602



textread is going away.  Try textscan instead.  You can 
skip fields.
Barry

"Wu Zhiyong" <wuzhiyong_163@163.com> wrote in message 
<fu4tt6$rjq$1@fred.mathworks.com>...
> I have a lot of data to read into matlab.They are 
printed 
> in the textfile as followed:
> 
> airpressure staions  bias      MAE     RMSE    
HR          
>   200.0       44   1.82511   2.34681  2.78835  22
> airpressure staions  bias      MAE     RMSE    HR
>  300.0        38   1.55661   1.83753  2.44242  26
>  &#8230;&#8230;
> I need to ignore the characters. I did it in two ways.
> 
>  1.delete the characters manually.And write the code as 
> followed:
> 
> [airpress sta bias mae rmse hr]=textread(filename,'%f %f 
%
> f %f %f %f');
> 
>  2.add the symbol "%" in front of the characters 
manually:
> 
> %airpressure staions bias      MAE     RMSE    
HR          
>   200.0       44   1.82511   2.34681  2.78835  22
> %airpressure staions bias       MAE     RMSE    HR
>  300.0        38   1.55661   1.83753  2.44242  26
>  &#8230;&#8230;
> 
> And write the code as followed:
> 
> [airpress sta bias mae rmse hr]=textread(filename,'%f %f 
%
> f %f %f %f','commentstyle','matlab');
> 
> Both ways worked.But there are a large number of data 
> files.And it costs too much time.  
>   Do you have any other way to ignore the characters?
>   Any suggestion is appreciated!
>   Thank you!
>