fixing a problem with the date format

Dear all,
I have
Inside my code I construct the vector A={
'01/11'
'02/11'
'03/11'
'04/11'
'05/11'
'06/11'
'07/11'
'08/11'
'09/11'
'10/11'
'11/08'
'12/08'
'01/09'
'02/09'
'03/09'
};
But when I save the output into an excel and then open it the format of the dates is wrong and irrelevent.
Is there a way to fix it within Matlab?
thanks

댓글 수: 1

Oleg Komarov
Oleg Komarov 2012년 8월 2일
Cannot reproduce the problem on Win7 64b R2012a.

댓글을 달려면 로그인하십시오.

 채택된 답변

Sabbas
Sabbas 2012년 8월 2일

0 개 추천

I found the solution
Before saving my results I just try
Anew=cellstr(datestr(datenum(A,'mm/yy'),' mm/yyyy'));
then I write my final output into excel and when I open it, the date structure is ok
thank you guys both!

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2012년 8월 2일

0 개 추천

xlswrite('yournamefile.xlsx',cellstr(datestr(datevec(A,'mm/yy'),'mm/yyyy')))

댓글 수: 1

Oleg Komarov
Oleg Komarov 2012년 8월 2일
@Sabbas: you provided A not output. What is output?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

질문:

2012년 8월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by