unable to download data from FRED with Datafeed Toolbox

조회 수: 2 (최근 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 CenterFile Exchange에서 Money.Net에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by