在MATLAB中,如果我使用fred
和fetch
函数,则会得到一个1x1 structure
,其中包含双精度数据。例如使用
url = 'https://fred.stlouisfed.org/';
c = fred(url);
series = 'DEXUSEU';
d = fetch(c,series)
输出为:
d =
struct with fields:
Title: ' U.S. / Euro Foreign Exchange Rate'
SeriesID: ' DEXUSEU'
Source: ' Board of Governors of the Federal Reserve System (US)'
Release: ' H.10 Foreign Exchange Rates'
SeasonalAdjustment: ' Not Seasonally Adjusted'
Frequency: ' Daily'
Units: ' U.S. Dollars to One Euro'
DateRange: ' 1999-01-04 to 2018-06-15'
LastUpdated: ' 2018-06-18 3:51 PM CDT'
Notes: ' Noon buying rates in New York City for cable transfers payable in foreign currencies.'
Data: [5075×2 double]
问题是我想从fred.stlouisfed.org
下载并保存原始 CSV文件(可以在网站上手动下载)。换句话说,我想避免使用例如csvwrite('filename.csv',d.Data)
重新创建CSV文件(与FRED的CSV文件不同),而只是下载并保存原始CSV文件从FRED中获取,而无需更改MATLAB。