-
Notifications
You must be signed in to change notification settings - Fork 46
SDMX Connector for MATLAB
MatSDMX is the MATLAB Connector for SDMX.
All the instructions that follow refer to linux, but they can be easily adapted to Windows installations.
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
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.
-
Download the latest stable release of the toolbox (file name: MatSDMX.mltbx) from the downloads section of the releases.
-
From the MATLAB file explorer, double click the toolbox file
-
Click install in the installation dialog.
More information about custom toolboxes can be found in the MATLAB help pages
-
Download the latest stable release of the tar.gz package (file name: matlabsdmx.tar.gz) from the downloads section of the releases.
-
Unzip/untar the bundle.
-
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.
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 sdmxtable function to convert the series list. This is supported only in MATLAB 2013B and higher versions (when the tables were introduced).
tstable = sdmxtable(result , true)