<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239444</link>
    <title>MATLAB Central Newsreader - problems using textread</title>
    <description>Feed for thread: problems using textread</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 18 Nov 2008 20:48:02 -0500</pubDate>
      <title>problems using textread</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239444#611639</link>
      <author>Matthew </author>
      <description>i am trying to read in the 3rd value of the 1st numerical line 0.000 0.6149 0.00834 ........ of the file below using textread. however i am having a lot of problems and it just will not read the line i want. it is the first time i have used this type of text scanning read in method and it is starting to annoy me. i want to read the value in exactly as is shown in the file below then assign it to the variable Cd.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XFOIL         Version 6.94&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;Calculated polar for: test airfoil                                    &lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;1 1 Reynolds number fixed          Mach number fixed         &lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;xtrf =   0.500 (top)        0.500 (bottom)  &lt;br&gt;
&amp;nbsp;Mach =   0.100     Re =     1.000 e 6     Ncrit =   9.000&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;alpha     CL        CD       CDp       CM    Top_Xtr Bot_Xtr&lt;br&gt;
&amp;nbsp;------- -------- --------- --------- -------- ------- -------&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
any help on this matter who be greatly appreciated as it does not seem to matter how i construct my code i just cannot get it to work :(</description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 20:56:12 -0500</pubDate>
      <title>Re: problems using textread</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239444#611644</link>
      <author>Vadim Teverovsky</author>
      <description>Two suggestions:&lt;br&gt;
1)  Use textscan instead of textread, it is the newer more full-featured &lt;br&gt;
function.&lt;br&gt;
2) Please post your code, otherwise its difficult to help.  You likely need &lt;br&gt;
to skip some number of headerlines, and then should be able to read the&lt;br&gt;
numeric data.&lt;br&gt;
&quot;Matthew &quot; &amp;lt;men5mjr@leeds.ac.uk&amp;gt; wrote in message &lt;br&gt;
news:gfv9m2$968$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;i am trying to read in the 3rd value of the 1st numerical line 0.000 0.6149 &lt;br&gt;
&amp;gt;0.00834 ........ of the file below using textread. however i am having a &lt;br&gt;
&amp;gt;lot of problems and it just will not read the line i want. it is the first &lt;br&gt;
&amp;gt;time i have used this type of text scanning read in method and it is &lt;br&gt;
&amp;gt;starting to annoy me. i want to read the value in exactly as is shown in &lt;br&gt;
&amp;gt;the file below then assign it to the variable Cd.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;       XFOIL         Version 6.94&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Calculated polar for: test airfoil&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 1 1 Reynolds number fixed          Mach number fixed&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; xtrf =   0.500 (top)        0.500 (bottom)&lt;br&gt;
&amp;gt; Mach =   0.100     Re =     1.000 e 6     Ncrit =   9.000&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;  alpha     CL        CD       CDp       CM    Top_Xtr Bot_Xtr&lt;br&gt;
&amp;gt; ------- -------- --------- --------- -------- ------- -------&lt;br&gt;
&amp;gt;   0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;   0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;   0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;   0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;   0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;   0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;   0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;   0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; any help on this matter who be greatly appreciated as it does not seem to &lt;br&gt;
&amp;gt; matter how i construct my code i just cannot get it to work :(&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 20:57:02 -0500</pubDate>
      <title>Re: problems using textread</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239444#611645</link>
      <author>Luca Zanotti Fragonara</author>
      <description>fin=fopen('filename','rt')&lt;br&gt;
A=textread(fin,'%f %f %f %f %f %f %f','endofline','\n','Headerlines',number);&lt;br&gt;
fclose(fin);&lt;br&gt;
where number is the number of the row where you want to start to read the file.&lt;br&gt;
in A{3} you have your Cd, so&lt;br&gt;
CD=A{3}(:,1);&lt;br&gt;
&lt;br&gt;
&quot;Matthew &quot; &amp;lt;men5mjr@leeds.ac.uk&amp;gt; wrote in message &amp;lt;gfv9m2$968$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; i am trying to read in the 3rd value of the 1st numerical line 0.000 0.6149 0.00834 ........ of the file below using textread. however i am having a lot of problems and it just will not read the line i want. it is the first time i have used this type of text scanning read in method and it is starting to annoy me. i want to read the value in exactly as is shown in the file below then assign it to the variable Cd.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;        XFOIL         Version 6.94&lt;br&gt;
&amp;gt;   &lt;br&gt;
&amp;gt;  Calculated polar for: test airfoil                                    &lt;br&gt;
&amp;gt;   &lt;br&gt;
&amp;gt;  1 1 Reynolds number fixed          Mach number fixed         &lt;br&gt;
&amp;gt;   &lt;br&gt;
&amp;gt;  xtrf =   0.500 (top)        0.500 (bottom)  &lt;br&gt;
&amp;gt;  Mach =   0.100     Re =     1.000 e 6     Ncrit =   9.000&lt;br&gt;
&amp;gt;   &lt;br&gt;
&amp;gt;   alpha     CL        CD       CDp       CM    Top_Xtr Bot_Xtr&lt;br&gt;
&amp;gt;  ------- -------- --------- --------- -------- ------- -------&lt;br&gt;
&amp;gt;    0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;    0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;    0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;    0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;    0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;    0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;    0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt;    0.000   0.6149   0.00834   0.00179  -0.1316  0.5000  0.1997&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; any help on this matter who be greatly appreciated as it does not seem to matter how i construct my code i just cannot get it to work :(&lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 21:40:20 -0500</pubDate>
      <title>Re: problems using textread</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239444#611659</link>
      <author>Luca Zanotti Fragonara</author>
      <description>Sorry, I've posted 2 times, and this is the third. But I've posted a wrong code. I've written textread, while I was thinking at textscan. So the correct code is:&lt;br&gt;
fin=fopen('filename','rt')&lt;br&gt;
A=textscan(fin,'%f %f %f %f %f %f %f','endofline','\n','Headerlines',number);&lt;br&gt;
fclose(fin);&lt;br&gt;
CD=A{3}(:,1);&lt;br&gt;
&lt;br&gt;
&quot;Luca Zanotti Fragonara&quot; &amp;lt;Luca_Zanotti@libero.it&amp;gt; wrote in message &amp;lt;gfva6u$grj$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; fin=fopen('filename','rt')&lt;br&gt;
&amp;gt; A=textread(fin,'%f %f %f %f %f %f %f','endofline','\n','Headerlines',number);&lt;br&gt;
&amp;gt; fclose(fin);&lt;br&gt;
&amp;gt; where number is the number of the row where you want to start to read the file.&lt;br&gt;
&amp;gt; in A{3} you have your Cd, so&lt;br&gt;
&amp;gt; CD=A{3}(:,1);&lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 15:52:02 -0500</pubDate>
      <title>Re: problems using textread</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239444#611827</link>
      <author>Matthew </author>
      <description>Luca,&lt;br&gt;
&lt;br&gt;
thank you, it was a comn=bination of the headerlines and the %f's i was using i think??? but it is working fine now so thanks a lot!!&lt;br&gt;
&lt;br&gt;
Matthew&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Luca Zanotti Fragonara&quot; &amp;lt;Luca_Zanotti@libero.it&amp;gt; wrote in message &amp;lt;gfvco4$ke0$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Sorry, I've posted 2 times, and this is the third. But I've posted a wrong code. I've written textread, while I was thinking at textscan. So the correct code is:&lt;br&gt;
&amp;gt; fin=fopen('filename','rt')&lt;br&gt;
&amp;gt; A=textscan(fin,'%f %f %f %f %f %f %f','endofline','\n','Headerlines',number);&lt;br&gt;
&amp;gt; fclose(fin);&lt;br&gt;
&amp;gt; CD=A{3}(:,1);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Luca Zanotti Fragonara&quot; &amp;lt;Luca_Zanotti@libero.it&amp;gt; wrote in message &amp;lt;gfva6u$grj$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; fin=fopen('filename','rt')&lt;br&gt;
&amp;gt; &amp;gt; A=textread(fin,'%f %f %f %f %f %f %f','endofline','\n','Headerlines',number);&lt;br&gt;
&amp;gt; &amp;gt; fclose(fin);&lt;br&gt;
&amp;gt; &amp;gt; where number is the number of the row where you want to start to read the file.&lt;br&gt;
&amp;gt; &amp;gt; in A{3} you have your Cd, so&lt;br&gt;
&amp;gt; &amp;gt; CD=A{3}(:,1);&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
  </channel>
</rss>

