No BSD License  

Highlights from
Data visualization 2009 contest data downloader

from Data visualization 2009 contest data downloader by Rajiv Narayan
Downloads dataset for the data visualization contest.

get_contest_data(cwd)
% GET_CONTEST_DATA Download dataset for the Data visualization contest 2009 
% GET_CONTEST_DATA  Downloads the data to the current folder. 
% GET_CONTEST_DATA(WD) Downloads the data to the folder WD.

function get_contest_data(cwd) 
url='http://www.mathworks.com/matlabcentral/fileexchange/23509?controller=file_infos&download=true';
datafile='contest_data.mat';
zipfile='entry1.zip';

if ~exist('cwd', 'var')
    cwd=pwd;
end

if exist (cwd, 'dir')
    isfileexist= isequal(exist(fullfile(cwd, datafile), 'file'),2);
    if ~isfileexist
        try
            td=tempname;
            tmpoutfile = fullfile(td, zipfile);
            mkdir (td);
            urlwrite(url, tmpoutfile);
            unzip (tmpoutfile, td);
            movefile(fullfile(td, datafile), cwd);
            rmdir(td,'s');
            fprintf('%s saved to %s\n', datafile, cwd);
        catch
            err=lasterror;
            disp(err.message)
        end
    else
        fprintf ('File %s exists, not downloading\n', datafile);
    end
else
    
    error('Folder %s not found', cwd)
end

Contact us at files@mathworks.com