Any ideas why I am getting this 'catch' error? Does anyone know how I can solve it?
19 次查看(过去 30 天)
显示 更早的评论
%Code to Get Matrix
fid=fopen('C:\Users\Laurentiu Galan\Desktop\Tickers.csv');
C = textscan(fid, '%s');
fclose(fid);
%Grab First Value (Just as check)
thisval=(C{1});
% Calculate Number of Tickers
D=size(thisval);
NumTick=D(1,1);
%Calculate Loop to download tickers
for i=1:NumTick
thissym=thisval{i};
thisurl = strcat('http://ichart.finance.yahoo.com/table.csv?s=', thissym, '&d=10&e=8&f=2011&g=d&a=0&b=1&c=2000&ignore=.csv');
thisdata=urlread(thisurl);
catch continue;
end
thisfilename = strcat(thissym, '.csv');
outputfile = strcat('C:\Users\Laurentiu Galan\Desktop\tickoutput\',thisfilename);
thisfileid=fopen(outputfile, 'wt')
fprintf(thisfileid, '%s\n',thisdata)
fclose(thisfileid)
end
I am getting an error right after the catch, saying illegal use of the word. Any ideas how I can solve this? I know the rest of the code works. Basically, I am trying to get the code to download the tickers from yahoo finance and to skip the ticker if there is a url read error.
Thanks
0 个评论
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Web Services 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!