Skip to content

SDMX Connector for MATLAB

Attilio Mattiocco edited this page Aug 9, 2024 · 23 revisions

MatSDMX is the SDMX Connector for MATLAB.

All the instructions that follow refer to linux, but they can be easily adapted to Windows installations.


How to build it

The only part of the connector that needs to be built is the Java library. Instructions can be found in the java section

NOTE: building the java library is not strictly necessary. A jar file, ready to be used, can be found in the release lib subdirectory


How to install it

If you use MATLAB 2015A or higher, you can install it as a custom toolbox. For earlier versions you'll have to follow the manual installation steps.

Custom Toolbox Installation (only for MATLAB)

  1. Download the latest stable release of the toolbox (file name: MatSDMX.mltbx) from the downloads section of the releases. Alternatively you can download it from MatlabCentral

  2. From the MATLAB file explorer, double click the toolbox file

  3. Click install in the installation dialog.

More information about custom toolboxes can be found in the MATLAB help pages

Manual Installation (MATLAB)

  1. Download the latest stable release of the tar.gz package (file name: matlabsdmx.tar.gz) from the downloads section of the releases.

  2. Unzip/untar the bundle.

  3. Add the folder that you just unzipped to the MATLAB search path. This task can be accomplished in different ways. You can refer to the MATLAB online help for the most suitable one.


If necessary, override the default configuration by means of a custom configuration file. This is particularly necessary if you want to run the connector in an environment that connects to the internet by means of a proxy.


How to use it

Help pages can be obtained in the usual way:

doc MatSDMX

Get the list of available data providers:

getProviders

Get the list of available data flows for data provider ECB:

flows=getFlows('ECB')

If we want to refine the search with a search pattern:

exr=getFlows('ECB', '*Exchange*')

Get the list of dimensions for data flow EXR:

dims=getDimensions('ECB', 'EXR')

As an alternative, we can explore all the metadata of interest with the graphical SDMX helper:

sdmxHelp

Finally, let's get some data (I guess this is what you really want...)

single time series, freq=A, CURRENCY=USD
result = getTimeSeries('ECB', 'EXR/A.USD.EUR.SP00.A')

multiple time series, FREQUENCY=A (annual), all currencies
result = getTimeSeries('ECB', 'EXR/A..EUR.SP00.A')

multiple time series, all currencies, freq = A or M (monthly)
result = getTimeSeries('ECB', 'EXR/M+A..EUR.SP00.A')

NOTE: data calls will return a cell array of timeseries classes. The time series metadata is stored in the UserData slot

If you prefer to work with a MATLAB table you can use the getTimeSeriesTable function to get it. This is supported only in MATLAB 2013B and higher versions (when the tables were introduced).

tstable = getTimeSeriesTable('ECB', 'EXR/M+A..EUR.SP00.A')