Skip to Main Content Skip to Search
Product Documentation

haver.fetch - Request data from Haver Analytics database

Syntax

D = fetch(H,S)
D = fetch(H,S,Startdate,Enddate)
D = fetch(H,S,Startdate,Enddate,P)

Arguments

H

Haver Analytics connection object created with the haver function.

S

Haver Analytics variable.

Startdate

MATLAB string or date number indicating the startdate from which to retrieve data.

Enddate

MATLAB string or date number indicating the enddate of the date range.

P

A specified period. You can enter the period as:

  • D for daily values

  • W for weekly values

  • M for monthly values

  • Q for quarterly values

  • A for annual values

Description

fetch returns historical data via a Haver Analytics connection object.

D = fetch(H,S) returns data for the Haver Analytics variable S, using the connection object H.

D = fetch(H,S,Startdate,Enddate) returns data for the Haver Analytics variable S, using the connection object H, between the dates Startdate and Enddate.

D = fetch(H,S,Startdate,Enddate,P) returns data for the Haver Analytics variable S, using the connection object H, between the dates Startdate and Enddate, in time periods specified by P.

Examples

Establish a Connection to a Haver Analytics Database

Connect to the Haver Analytics daily demonstration database haverd.dat:

H = haver('d:\work\haver\data\haverd.dat')

Retrieving Variable Data

Return data for the variable FFED:

D = fetch(H,'FFED')

Retrieving Variable Data for a Specified Date Range

Return data for FFED from 01/01/1997 to 09/01/2007:

D = fetch(H,'FFED','01/01/1997','09/01/2007')

Retrieving Monthly Variable Data for a Specified Date Range

Return data for FFED, converted to monthly values, from 01/01/1997 to 09/01/2007:

D = fetch(H,'FFED','01/01/1997','09/01/2007','M')

See Also

haver | haver.close | haver.get | haver.info | haver.isconnection | haver.nextinfo

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS