Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: what's wrong in my dlmwrite?
Date: Thu, 19 Feb 2009 17:02:02 +0000 (UTC)
Organization: CSU
Lines: 25
Message-ID: <gnk3aa$6cd$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1235062922 6541 172.30.248.38 (19 Feb 2009 17:02:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 19 Feb 2009 17:02:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 951788
Xref: news.mathworks.com comp.soft-sys.matlab:519498


Dear all,

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. 

Thanks,
Michael 

The original file format:
  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
   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


The single file format after the process of "dlmwrite"
2004	1	0	0	0	212.1	0	271.55	24	97640	3.498585e-06
2004	1	0	30	0	211.4	0	271.55	24	97640	3.498585e-06


Here is my code to take care of my purposes:

delete('/Users/cks/Documents/Elora/weather/functions/Elora_met04_08_class.dat')
dlmwrite('Elora_met04_08_class.dat',Elora_met04_class,'-append','precision','%0.7g','delimiter','\t');
dlmwrite('Elora_met04_08_class.dat',Elora_met05_class,'-append','precision','%0.7g','delimiter','\t');
dlmwrite('Elora_met04_08_class.dat',Elora_met06_class,'-append','precision','%0.7g','delimiter','\t');
dlmwrite('Elora_met04_08_class.dat',Elora_met07_class,'-append','precision','%0.7g','delimiter','\t');
dlmwrite('Elora_met04_08_class.dat',Elora_met08_class,'-append','precision','%0.7g','delimiter','\t');