Export dataset to excel including serial date numbers

8 views (last 30 days)
Hi all,
ich have a dataset where the first column represents the time, in form of the matlab serial date number. When I use the function
export(DS,'XLSfile',filename)
the time I see in Excel is wrong by 1900 years, representing the different date systems. Is there an elegant way to export the whole dataset to excel with the first column beeing the time in form of the Excel serial date number? And wouldn't it probably make sense to incorporate such a function in the export function?
Regards, bearli

Answers (1)

Andrei Bobrov
Andrei Bobrov on 20 Mar 2013
Edited: Andrei Bobrov on 20 Mar 2013
Ds = datenum('30-Dec-2013') - 693960;
If you have Financial Toolbox, you can use function m2xdate.
Ds = m2xdate(datenum('30-Dec-2013'));
and see this is question.
  1 Comment
Bearli Ubuku
Bearli Ubuku on 20 Mar 2013
I'm aware of the function m2xdate. But DS would be a dataset containing dates in form of the matlab serial date number in the first column AND in the following columns my experimental data. I know that I could possibly add a second column with the xls date convention but that is not what im looking for.
Isn't there a better way? eg use of datasetfun?
Thanks, bearli

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!