Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
DD MM YYYY output

Subject: DD MM YYYY output

From: Cato

Date: 5 Apr, 2009 07:26:04

Message: 1 of 2

Hi Everyone,

Asking for some help here on how to write a code that changes file names to a different output (i.e. on a title of a time series). The file names are in a series (001-999) and each of these correspond to a day. So for 001 means Jan 1, 1999 and 002 means Jan 2, 1999. There is no Feb 29.

Your help is very much appreciated. Thank you.

Subject: DD MM YYYY output

From: Walter Roberson

Date: 5 Apr, 2009 17:00:42

Message: 2 of 2

Cato wrote:
> Asking for some help here on how to write a code that changes file names to a different output
> (i.e. on a title of a time series). The file names are in a series (001-999) and each
> of these correspond to a day. So for 001 means Jan 1, 1999 and 002 means Jan 2, 1999.
> There is no Feb 29.

If you were to datenum() on 'Jan 1, 1999' you would get Matlab's idea of the
"day number" for that date. From there, for any particular filename N,
add that base day number and subtract 1 in order to get Matlab's idea of the
'day number' for the relevant day. You can then use one of the Matlab routines
to convert that day number back to a printable date.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us