<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/244917</link>
    <title>MATLAB Central Newsreader - what's wrong in my dlmwrite?</title>
    <description>Feed for thread: what's wrong in my dlmwrite?</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>Mon, 23 Feb 2009 15:55:32 -0500</pubDate>
      <title>Re: what's wrong in my dlmwrite?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/244917#630231</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;Kuo-Hsien&quot; &amp;lt;mchangks@hotmail.com&amp;gt; wrote in message &lt;br&gt;
news:gnpc0d$3or$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; &quot;Kuo-Hsien&quot; &amp;lt;mchangks@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;gnk3aa$6cd$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; Dear all,&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; I like to append all weather files in a single file, so I use dlmwrite &lt;br&gt;
&amp;gt;&amp;gt; function here. However, the format in the single file did not match up &lt;br&gt;
&amp;gt;&amp;gt; with the original files, even I address the 'precision.' Please advice &lt;br&gt;
&amp;gt;&amp;gt; me.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Thanks,&lt;br&gt;
&amp;gt;&amp;gt; Michael&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; The original file format:&lt;br&gt;
&amp;gt;&amp;gt;   2.0040000e+03   1.0000000e+00   0.0000000e+00   0.0000000e+00 &lt;br&gt;
&amp;gt;&amp;gt; 0.0000000e+00   2.1210000e+02   0.0000000e+00   2.7155000e+02 &lt;br&gt;
&amp;gt;&amp;gt; 2.4000000e+01   9.7640000e+04   3.4985847e-06&lt;br&gt;
&amp;gt;&amp;gt;    2.0040000e+03   1.0000000e+00   0.0000000e+00   3.0000000e+01 &lt;br&gt;
&amp;gt;&amp;gt; 0.0000000e+00   2.1140000e+02   0.0000000e+00   2.7155000e+02 &lt;br&gt;
&amp;gt;&amp;gt; 2.4000000e+01   9.7640000e+04   3.4985847e-06&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; The single file format after the process of &quot;dlmwrite&quot;&lt;br&gt;
&amp;gt;&amp;gt; 2004 1 0 0 0 212.1 0 271.55 24 97640 3.498585e-06&lt;br&gt;
&amp;gt;&amp;gt; 2004 1 0 30 0 211.4 0 271.55 24 97640 3.498585e-06&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Here is my code to take care of my purposes:&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; delete('/Users/cks/Documents/Elora/weather/functions/Elora_met04_08_class.dat')&lt;br&gt;
&amp;gt;&amp;gt; dlmwrite('Elora_met04_08_class.dat',Elora_met04_class,'-append','precision','%0.7g','delimiter','\t');&lt;br&gt;
&lt;br&gt;
Look at &quot;doc fprintf&quot; for what the precision specifier '%g' does.  You don't &lt;br&gt;
want it to use the most compact of %e and %f, you want to use either %e or &lt;br&gt;
%f.  I'll let you figure out which one you want to make the output of &lt;br&gt;
DLMWRITE agree with your original file format.&lt;br&gt;
&lt;br&gt;
*snip*&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com </description>
    </item>
    <item>
      <pubDate>Thu, 19 Feb 2009 17:02:02 -0500</pubDate>
      <title>what's wrong in my dlmwrite?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/244917#629516</link>
      <author>Kuo-Hsien </author>
      <description>Dear all,&lt;br&gt;
&lt;br&gt;
I like to append all weather files in a single file, so I use dlmwrite function here. However, the format in the single file did not match up with the original files, even I address the 'precision.' Please advice me. &lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Michael &lt;br&gt;
&lt;br&gt;
The original file format:&lt;br&gt;
&amp;nbsp;&amp;nbsp;2.0040000e+03   1.0000000e+00   0.0000000e+00   0.0000000e+00   0.0000000e+00   2.1210000e+02   0.0000000e+00   2.7155000e+02   2.4000000e+01   9.7640000e+04   3.4985847e-06&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;2.0040000e+03   1.0000000e+00   0.0000000e+00   3.0000000e+01   0.0000000e+00   2.1140000e+02   0.0000000e+00   2.7155000e+02   2.4000000e+01   9.7640000e+04   3.4985847e-06&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
The single file format after the process of &quot;dlmwrite&quot;&lt;br&gt;
2004	1	0	0	0	212.1	0	271.55	24	97640	3.498585e-06&lt;br&gt;
2004	1	0	30	0	211.4	0	271.55	24	97640	3.498585e-06&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Here is my code to take care of my purposes:&lt;br&gt;
&lt;br&gt;
delete('/Users/cks/Documents/Elora/weather/functions/Elora_met04_08_class.dat')&lt;br&gt;
dlmwrite('Elora_met04_08_class.dat',Elora_met04_class,'-append','precision','%0.7g','delimiter','\t');&lt;br&gt;
dlmwrite('Elora_met04_08_class.dat',Elora_met05_class,'-append','precision','%0.7g','delimiter','\t');&lt;br&gt;
dlmwrite('Elora_met04_08_class.dat',Elora_met06_class,'-append','precision','%0.7g','delimiter','\t');&lt;br&gt;
dlmwrite('Elora_met04_08_class.dat',Elora_met07_class,'-append','precision','%0.7g','delimiter','\t');&lt;br&gt;
dlmwrite('Elora_met04_08_class.dat',Elora_met08_class,'-append','precision','%0.7g','delimiter','\t');</description>
    </item>
    <item>
      <pubDate>Sat, 21 Feb 2009 17:01:01 -0500</pubDate>
      <title>Re: what's wrong in my dlmwrite?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/244917#629903</link>
      <author>Kuo-Hsien </author>
      <description>&quot;Kuo-Hsien&quot; &amp;lt;mchangks@hotmail.com&amp;gt; wrote in message &amp;lt;gnk3aa$6cd$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Dear all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I like to append all weather files in a single file, so I use dlmwrite function here. However, the format in the single file did not match up with the original files, even I address the 'precision.' Please advice me. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt; Michael &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The original file format:&lt;br&gt;
&amp;gt;   2.0040000e+03   1.0000000e+00   0.0000000e+00   0.0000000e+00   0.0000000e+00   2.1210000e+02   0.0000000e+00   2.7155000e+02   2.4000000e+01   9.7640000e+04   3.4985847e-06&lt;br&gt;
&amp;gt;    2.0040000e+03   1.0000000e+00   0.0000000e+00   3.0000000e+01   0.0000000e+00   2.1140000e+02   0.0000000e+00   2.7155000e+02   2.4000000e+01   9.7640000e+04   3.4985847e-06&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The single file format after the process of &quot;dlmwrite&quot;&lt;br&gt;
&amp;gt; 2004	1	0	0	0	212.1	0	271.55	24	97640	3.498585e-06&lt;br&gt;
&amp;gt; 2004	1	0	30	0	211.4	0	271.55	24	97640	3.498585e-06&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Here is my code to take care of my purposes:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; delete('/Users/cks/Documents/Elora/weather/functions/Elora_met04_08_class.dat')&lt;br&gt;
&amp;gt; dlmwrite('Elora_met04_08_class.dat',Elora_met04_class,'-append','precision','%0.7g','delimiter','\t');&lt;br&gt;
&amp;gt; dlmwrite('Elora_met04_08_class.dat',Elora_met05_class,'-append','precision','%0.7g','delimiter','\t');&lt;br&gt;
&amp;gt; dlmwrite('Elora_met04_08_class.dat',Elora_met06_class,'-append','precision','%0.7g','delimiter','\t');&lt;br&gt;
&amp;gt; dlmwrite('Elora_met04_08_class.dat',Elora_met07_class,'-append','precision','%0.7g','delimiter','\t');&lt;br&gt;
&amp;gt; dlmwrite('Elora_met04_08_class.dat',Elora_met08_class,'-append','precision','%0.7g','delimiter','\t');</description>
    </item>
  </channel>
</rss>

