unable to download data from FRED with Datafeed Toolbox

9 ビュー (過去 30 日間)
Amit K
Amit K 2017 年 1 月 23 日
編集済み: cy 2021 年 9 月 8 日
I'm unable to download data using the fred function. I've Matlab R13 and the Datafeed toolbox. I'm able to connect with the FRED website but unable to download the data with the code below. I understand there has been issues with the "http" and I've tried replacing it with "https". With the "https" I'm unable to connect so I kept the original "http" address and been able to connect.
c = fred('http://research.stlouisfed.org/fred2/series'); d = fetch(c,'DEXUSEU');
I'm getting the following error message:
ndex exceeds matrix dimensions.
Error in fred/fetch (line 94) d.Data = [datenum(str2num(tmp(:,1:4)),str2num(tmp(:,6:7)),str2num(tmp(:,9:10))) str2num(tmp(:,11:end))]; %#ok
Error in ChangeDetectionStudy6 (line 18) d = fetch(c,'DEXUSEU');
  6 件のコメント
Keith Taylor
Keith Taylor 2017 年 1 月 30 日
I tested the code on version 2016a using both
fred('https://research.stlouisfed.org/fred2/')
or
fred('https://fred.stlouisfed.org/')
and it worked. A couple of possible issues come to mind.
  1. The version of Matlab that you are using does not support https requests in the datafeed toolbox. Was this working recently and then suddenly stopped?
  2. Do you need to connect through a proxy? Are you sure that you're connecting the to FRED servers. One way to test, would be to try using the datafeed toolbox to pull data from another website like Yahoo! Finance. https://www.mathworks.com/help/datafeed/yahoo.html
cy
cy 2021 年 9 月 8 日
編集済み: cy 2021 年 9 月 8 日
On 9/2021
I'm using Matlab2014 and I'm getting the same error reported in this thread back in 2017. Note that this used to work in the past (Windows7 OS). It appears that I'm not getting connection to https url. See code below:
>> url = 'https://research.stlouisfed.org/fred2/'
url =
https://research.stlouisfed.org/fred2/
>> c = fred(url);
Error using fred (line 64)
Unable to connect to given URL.
If I try http address however, this is the command line:
url = 'http://research.stlouisfed.org/fred2/'
c = fred(url);
gdp = fetch(c, 'GDPC1');
This is the error message:
Index exceeds matrix dimensions.
Error in fred/fetch (line 93)
d.Data =
[datenum(str2num(tmp(:,1:4)),str2num(tmp(:,6:7)),str2num(tmp(:,9:10)))
str2num(tmp(:,11:end))]; %#ok

サインインしてコメントする。

回答 (1 件)

Kawee Numpacharoen
Kawee Numpacharoen 2017 年 8 月 4 日
I would suggest upgrading to newer version of MATLAB. Otherwise, you may need to contact MathWorks technical support for alternative solutions. By the way, Datafeed Toolbox no longer support Yahoo! Finance API.

カテゴリ

Help Center および File ExchangeFinancial Data についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by