<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238677</link>
    <title>MATLAB Central Newsreader - Write date in excel</title>
    <description>Feed for thread: Write date in excel</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>Wed, 05 Nov 2008 00:23:08 -0500</pubDate>
      <title>Write date in excel</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238677#609045</link>
      <author>Rosy</author>
      <description>Hello&lt;br&gt;
&lt;br&gt;
I am writing to ask a question on writing date in excel.&lt;br&gt;
&lt;br&gt;
What I am trying to do is to write date converted from date number in&lt;br&gt;
excel.&lt;br&gt;
For example,&lt;br&gt;
A = [730238&lt;br&gt;
730239&lt;br&gt;
730240&lt;br&gt;
730241&lt;br&gt;
730242&lt;br&gt;
730243&lt;br&gt;
730244&lt;br&gt;
730245&lt;br&gt;
730246&lt;br&gt;
730247];&lt;br&gt;
&lt;br&gt;
Date = datestr(A);&lt;br&gt;
xlswrite(xlsfilename, Date);&lt;br&gt;
&lt;br&gt;
However, the dates were not written in a cell but as follows&lt;br&gt;
&lt;br&gt;
2	8	/	0	4	/	9	9&lt;br&gt;
2	9	/	0	4	/	9	9&lt;br&gt;
3	0	/	0	4	/	9	9&lt;br&gt;
0	1	/	0	5	/	9	9&lt;br&gt;
0	2	/	0	5	/	9	9&lt;br&gt;
0	3	/	0	5	/	9	9&lt;br&gt;
0	4	/	0	5	/	9	9&lt;br&gt;
0	5	/	0	5	/	9	9&lt;br&gt;
0	6	/	0	5	/	9	9&lt;br&gt;
&lt;br&gt;
It would be great if you could help me.&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Eu Gene</description>
    </item>
    <item>
      <pubDate>Wed, 05 Nov 2008 00:51:32 -0500</pubDate>
      <title>Re: Write date in excel</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238677#609049</link>
      <author>gmtechproject@gmail.com</author>
      <description>On Nov 4, 4:23=A0pm, Rosy &amp;lt;egrosa...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hello&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am writing to ask a question on writing date in excel.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; What I am trying to do is to write date converted from date number in&lt;br&gt;
&amp;gt; excel.&lt;br&gt;
&amp;gt; For example,&lt;br&gt;
&amp;gt; A =3D [730238&lt;br&gt;
&amp;gt; 730239&lt;br&gt;
&amp;gt; 730240&lt;br&gt;
&amp;gt; 730241&lt;br&gt;
&amp;gt; 730242&lt;br&gt;
&amp;gt; 730243&lt;br&gt;
&amp;gt; 730244&lt;br&gt;
&amp;gt; 730245&lt;br&gt;
&amp;gt; 730246&lt;br&gt;
&amp;gt; 730247];&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Date =3D datestr(A);&lt;br&gt;
&amp;gt; xlswrite(xlsfilename, Date);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; However, the dates were not written in a cell but as follows&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 2 =A0 =A0 =A0 8 =A0 =A0 =A0 / =A0 =A0 =A0 0 =A0 =A0 =A0 4 =A0 =A0 =A0 / =&lt;br&gt;
=A0 =A0 =A0 9 =A0 =A0 =A0 9&lt;br&gt;
&amp;gt; 2 =A0 =A0 =A0 9 =A0 =A0 =A0 / =A0 =A0 =A0 0 =A0 =A0 =A0 4 =A0 =A0 =A0 / =&lt;br&gt;
=A0 =A0 =A0 9 =A0 =A0 =A0 9&lt;br&gt;
&amp;gt; 3 =A0 =A0 =A0 0 =A0 =A0 =A0 / =A0 =A0 =A0 0 =A0 =A0 =A0 4 =A0 =A0 =A0 / =&lt;br&gt;
=A0 =A0 =A0 9 =A0 =A0 =A0 9&lt;br&gt;
&amp;gt; 0 =A0 =A0 =A0 1 =A0 =A0 =A0 / =A0 =A0 =A0 0 =A0 =A0 =A0 5 =A0 =A0 =A0 / =&lt;br&gt;
=A0 =A0 =A0 9 =A0 =A0 =A0 9&lt;br&gt;
&amp;gt; 0 =A0 =A0 =A0 2 =A0 =A0 =A0 / =A0 =A0 =A0 0 =A0 =A0 =A0 5 =A0 =A0 =A0 / =&lt;br&gt;
=A0 =A0 =A0 9 =A0 =A0 =A0 9&lt;br&gt;
&amp;gt; 0 =A0 =A0 =A0 3 =A0 =A0 =A0 / =A0 =A0 =A0 0 =A0 =A0 =A0 5 =A0 =A0 =A0 / =&lt;br&gt;
=A0 =A0 =A0 9 =A0 =A0 =A0 9&lt;br&gt;
&amp;gt; 0 =A0 =A0 =A0 4 =A0 =A0 =A0 / =A0 =A0 =A0 0 =A0 =A0 =A0 5 =A0 =A0 =A0 / =&lt;br&gt;
=A0 =A0 =A0 9 =A0 =A0 =A0 9&lt;br&gt;
&amp;gt; 0 =A0 =A0 =A0 5 =A0 =A0 =A0 / =A0 =A0 =A0 0 =A0 =A0 =A0 5 =A0 =A0 =A0 / =&lt;br&gt;
=A0 =A0 =A0 9 =A0 =A0 =A0 9&lt;br&gt;
&amp;gt; 0 =A0 =A0 =A0 6 =A0 =A0 =A0 / =A0 =A0 =A0 0 =A0 =A0 =A0 5 =A0 =A0 =A0 / =&lt;br&gt;
=A0 =A0 =A0 9 =A0 =A0 =A0 9&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; It would be great if you could help me.&lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Eu Gene&lt;br&gt;
you can write your data with comma separated values in notepad,and&lt;br&gt;
save with extension .csv it automatically  write in column wise.then&lt;br&gt;
you can read the data from excel sheet.</description>
    </item>
    <item>
      <pubDate>Wed, 05 Nov 2008 00:55:34 -0500</pubDate>
      <title>Re: Write date in excel</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238677#609051</link>
      <author>Walter Roberson</author>
      <description>Rosy wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; Date = datestr(A);&lt;br&gt;
&amp;gt; xlswrite(xlsfilename, Date);&lt;br&gt;
&lt;br&gt;
If you are communicating with a &quot;real&quot; Excel (via a COM service on MS Windows) then&lt;br&gt;
there might be a way such as (guessing here)&lt;br&gt;
&lt;br&gt;
xlswrite(xlsfilename, cellstr(Date));&lt;br&gt;
&lt;br&gt;
If, however, you are on any of the other operating systems or you (for whatever reason)&lt;br&gt;
cannot get a COM session established to Excel (e.g., if you don't actually have Excel&lt;br&gt;
installed and are just wanting the file format), then xlswrite is only able to write in&lt;br&gt;
comma separated value format (CSV), not true Excel files. And if you are in that&lt;br&gt;
situation, then you have to deal with the fact that xlswrite will treate each individual&lt;br&gt;
character as being a separate array value (which is how characters are stored in Matlab)&lt;br&gt;
and will write them out one per cell, with the delimeter in between. In order to avoid&lt;br&gt;
that happening, you have to use dlmwrite() instead and tell it that the cell delimiter&lt;br&gt;
is '' (the empty string): that will cause dlmwrite to put each row of text into a cell&lt;br&gt;
(one per line). But if you are doing that, then you have a bit of a mess if you are trying&lt;br&gt;
to combine text and numeric data in the output; the only way to get around that is to&lt;br&gt;
convert -everything- to text ahead of time (e.g., using sprintf() or num2str())&lt;br&gt;
and write it all out using dlmwrite() with the delimiter set to '' (the empty string),&lt;br&gt;
and in this situation you have to &quot;manually&quot; put in the commas where you want them.&lt;br&gt;
&lt;br&gt;
For example,&lt;br&gt;
&lt;br&gt;
dlmwrite(xlsfilename, ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;[char(Date), repmat(',', size(Date,1), 1), num2str(SomeRowVector .')], ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;'Delimiter', '');&lt;br&gt;
&lt;br&gt;
just to get the date followed by a comma followed by a number, one per line.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
.signature note: I am now avoiding replying to unclear or ambiguous postings.&lt;br&gt;
Please review questions before posting them. Be specific. Use examples of what you mean,&lt;br&gt;
of what you don't mean. Specify boundary conditions, and data classes and value&lt;br&gt;
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?</description>
    </item>
  </channel>
</rss>

