This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Data Preprocessing

Financial market data for dates and currencies

The representation and quality of data is essential before running an analysis. Financial data is often in formats that require conversion to standard formats. This toolbox provides a suite of tools to organize and transform financial data for analysis.


now Current date and time as serial date number
today Current date
datefind Indices of dates in matrix
datevec Convert date and time to vector of components
datetime Create array based on current date, or convert from date strings or numbers
day Day of month
eomdate Last date of month
hour Hour of date or time
lweekdate Date of last occurrence of weekday in month
second Seconds of date or time
minute Minute of date or time
month Month of date
months Number of whole months between dates
nweekdate Date of specific occurrence of weekday in month
weeknum Week in year
year Year of date
yeardays Number of days in year
date2time Time and frequency from dates
datedisp Display date entries
datenum Convert date and time to serial date number
datestr Convert date and time to string format
m2xdate MATLAB date to Excel serial date number
time2date Dates from time and frequency
uicalendar Graphical calendar
x2mdate Excel serial date number to MATLAB serial date number or datetime format
busdate Next or previous business day
busdays Business days for given period
datemnth Date of day in future or past month
datewrkdy Date of future or past workday
days360 Days between dates based on 360-day year
days360e Days between dates based on 360-day year (European)
days360isda Days between dates based on 360-day year (International Swap Dealer Association (ISDA) compliant)
days360psa Days between dates based on 360-day year (Public Securities Association (PSA) compliant)
days365 Days between dates based on 365-day year
daysact Actual number of days between dates
daysadd Date away from starting date for any day-count basis
daysdif Days between dates for any for any day-count basis
fbusdate First business date of month
isbusday True for dates that are business days
lbusdate Last business date of month
quarter Returns the quarter of given date
thirdwednesday Find third Wednesday of month
wrkdydif Number of working days between dates
yearfrac Fraction of year between dates
createholidays Create trading calendars
holidays Holidays and nontrading days
nyseclosures New York Stock Exchange closures from 1885 to 2050
accrfrac Fraction of coupon period before settlement
cpncount Coupon payments remaining until maturity
cpndaten Next coupon date for fixed-income security
cpndatenq Next quasi-coupon date for fixed-income security
cpndatepq Previous quasi-coupon date for fixed-income security
cpndatep Previous coupon date for fixed-income security
cpndaysn Number of days to next coupon date
cpndaysp Number of days since previous coupon date
cpnpersz Number of days in coupon period
cur2frac Decimal currency values to fractional values
cur2str Bank-formatted text
dec2thirtytwo Decimal to thirty-second quotation
frac2cur Fractional currency value to decimal value
thirtytwo2dec Thirty-second quotation to decimal


Handle and Convert Dates

Handle and convert date character vectors and serial date numbers, holidays, and cash-flow dates.

Was this topic helpful?