

    \filetitle{dat2str}{Convert IRIS dates to cell array of strings}{dates/dat2str}

	\paragraph{Syntax}

\begin{verbatim}
S = dat2str(Dat,...)
\end{verbatim}

\paragraph{Input arguments}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  \texttt{Dat} {[} numeric {]} - IRIS serial date number(s).
\end{itemize}

\paragraph{Output arguments}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  \texttt{S} {[} cellstr {]} - Cellstr with strings representing the
  input dates.
\end{itemize}

\paragraph{Options}

\begin{itemize}
\item
  \texttt{'dateFormat='} {[} char \textbar{} cellstr \textbar{}
  \emph{`YYYYFP'} {]} - Date format string, or array of format strings
  (possibly different for each date).
\item
  \texttt{'freqLetters='} {[} char \textbar{} \emph{`YHQBM'} {]} -
  Letters representing the five possible frequencies
  (annual,semi-annual,quarterly,bimontly,monthly).
\item
  \texttt{'months='} {[} cellstr \textbar{} \emph{English names of
  months} {]} - Cell array of twelve strings representing the names of
  months.
\item
  \texttt{'standinMonth='} {[} numeric \textbar{} \texttt{'last'}
  \textbar{} \texttt{*1*} {]} - Which month will represent a
  lower-than-monthly-frequency date if month is part of the date format
  string.
\end{itemize}

\paragraph{Description}

There are two types of date strings in IRIS: year-period strings and
calendar date strings. The year-period strings can be printed for dates
with yearly, half-yearly, quarterly, bimonthly, monthly, weekly, and
indeterminate frequencies. The calendar date strings can be printed for
dates with weekly and daily frequencies. Date formats for calendar date
strings must start with a dollar sign, \texttt{\$}.

\subparagraph{Year-period date strings}

Regular date formats can include any combination of the following
fields:

\begin{itemize}
\item
  \texttt{'Y'} - Year.
\item
  \texttt{'YYYY'} - Four-digit year.
\item
  \texttt{'YY'} - Two-digit year.
\item
  \texttt{'P'} - Period within the year (half-year, quarter, bi-month,
  month, week).
\item
  \texttt{'PP'} - Two-digit period within the year.
\item
  \texttt{'R'} - Upper-case roman numeral for the period within the
  year.
\item
  \texttt{'r'} - Lower-case roman numeral for the period within the
  year.
\item
  \texttt{'M'} - Month numeral.
\item
  \texttt{'MM'} - Two-digit month numeral.
\item
  \texttt{'MMMM'}, \texttt{'Mmmm'}, \texttt{'mmmm'} - Case-sensitive
  name of month.
\item
  \texttt{'MMM'}, \texttt{'Mmm'}, \texttt{'mmm'} - Case-sensitive
  three-letter abbreviation of month.
\item
  \texttt{'Q'} - Upper-case roman numeral for the month or stand-in
  month.
\item
  \texttt{'r'} - Lower-case roman numeral for the month or stand-in
  month.
\item
  \texttt{'F'} - Upper-case letter representing the date frequency.
\item
  \texttt{'f'} - Lower-case letter representing the date frequency.
\item
  \texttt{'EE'} - Two-digit end-of-month day; stand-in month used for
  non-monthly dates.
\item
  \texttt{'E'} - End-of-month day; stand-in month used for non-monthly
  dates.
\item
  \texttt{'WW'} - Two-digit end-of-month workday; stand-in month used
  for non-monthly dates.
\item
  \texttt{'W'} - End-of-month workday; stand-in month used for
  non-monthly dates.
\end{itemize}

\subparagraph{Calendar date strings}

Calendar date formats must start with a dollar sign, \texttt{\$}, and
can include any combination of the following fields:

\begin{itemize}
\item
  \texttt{'Y'} - Year.
\item
  \texttt{'YYYY'} - Four-digit year.
\item
  \texttt{'YY'} - Two-digit year.
\item
  \texttt{'DD'} - Two-digit day numeral; daily and weekly dates only.
\item
  \texttt{'D'} - Day numeral; daily and weekly dates only.
\item
  \texttt{'M'} - Month numeral.
\item
  \texttt{'MM'} - Two-digit month numeral.
\item
  \texttt{'MMMM'}, \texttt{'Mmmm'}, \texttt{'mmmm'} - Case-sensitive
  name of month.
\item
  \texttt{'MMM'}, \texttt{'Mmm'}, \texttt{'mmm'} - Case-sensitive
  three-letter abbreviation of month.
\item
  \texttt{'Q'} - Upper-case roman numeral for the month.
\item
  \texttt{'r'} - Lower-case roman numeral for the month.
\item
  \texttt{'DD'} - Two-digit day numeral.
\item
  \texttt{'D'} - Day numeral.
\end{itemize}

\subparagraph{Escaping control letters}

To get the format letters printed literally in the date string, use a
percent sign as an escape character: \texttt{'\%Y'}, \texttt{'\%P'},
\texttt{'\%F'}, \texttt{'\%f'}, \texttt{'\%M'}, \texttt{'\%m'},
\texttt{'\%R'}, \texttt{'\%r'}, \texttt{'\%Q'}, \texttt{'\%q'},
\texttt{'\%D'}, \texttt{'\%E'}, \texttt{'\%D'}.

\paragraph{Example}


