replicating dates and inporting them in an excel file

2 ビュー (過去 30 日間)
ektor
ektor 2012 年 5 月 18 日
HI all,
I want to replicate the dates '02/11/2008' '30/11/2008' so at to have
02/11/2008
30/11/2008
02/11/2008
'30/11/2008
So the repetition is every two elements. I apply the following code" dd=[{'02/11/2008' '30/11/2008'} ]';
B = dd(:,ones(4,1));
ss= B(:);
which seems to work but when i try to extract the variable ss in an excel file, then the output of the excel file is
39489
30/11/2008
39489
30/11/2008 39489
30/11/2008
39489
30/11/2008
39489
30/11/2008
Is there anything I can do to fix this problem?

採用された回答

bym
bym 2012 年 5 月 18 日
change the format of the excel cell to 'date'. You can verify by entering formula in a cell =datevalue("2/11/2008") and the result is 39489
  1 件のコメント
ektor
ektor 2012 年 5 月 18 日
Thanks. It works. I was wondering if there is another way to fix it so as not to have to change the format of the excel cell to 'date'. I mean if it is possible to do that correction directly within matlab without having to do the modifications within excel.
Thanks again.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by