Writing time data into excel

I have an array of data stored in matlab as such:
time=
‘14:43:51.89567’
‘15:12:43.32253’
‘15:34:65.97059’
‘16:34:30.45221’
When I write this data into excel using xlswrite, the data shows up in excel written as a different format. I want the format to be exactly the same in excel as it is stored in matlab in the variable time as shown above.

 Accepted Answer

This is probably one of the dumbest thing that Excel does. Sometimes I hate it too. What I did is like this:
time={'14:43:51.89567'
'15:12:43.32253'
'15:34:65.97059'
'16:34:30.45221'};
NewFormat=strcat('''',time);
xlswrite('test.xls',NewFormat);

1 Comment

Thank you,
I will test that code out right now and get back to you.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!