Write one year date into a excel?

If I want to write one year date into a excel, like year 2016. I have no idea how to code in matlab. Thanks
1/1/2016
1/2/2016
...
..
12/31/2016

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 13 de Abr. de 2016
Editada: Azzi Abdelmalek el 13 de Abr. de 2016
out=datestr(datenum('01/01/2016')+datenum(0:365),'mm/dd/yyyy')
xlswrite('your_file.xlsx',out)

6 comentarios

Jason
Jason el 13 de Abr. de 2016
This code will output 01/01/2016, can you remove zero?
datenum
explain it plz
Read the documentation
doc datenum
Jason
Jason el 13 de Abr. de 2016
I just tried that we need not the code. In Excel, when we enter 1/1/2016, then drag the cell, the following cells will increase the date automatically
out=datestr(datenum('01/01/2016')+(0:365)','mm/dd/yyyy');
Muhammad Usman Saleem
Muhammad Usman Saleem el 13 de Abr. de 2016
thanks Azzi

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 13 de Abr. de 2016

Comentada:

el 13 de Abr. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by