Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 13 lines (9 sloc) 0.333 kb
1 2 3 4 5 6 7 8 9 10 11 12 13
function data = loadForecast(year)

filename = sprintf('forecast/USElectionForecast%s.csv',num2str(year));
    fid = fopen(filename);
    fmt = '%s %s %f%%';
    
    csv = textscan(fid,fmt,'headerlines',1,'delimiter',',');
    
    data.state = csv{1};
    data.prediction = csv{2};
    data.confidence = csv{3} / 100;

end
Something went wrong with that request. Please try again.