%% load data fid = fopen('fahrradwetterstatistik.dat'); fdata = cell2mat(textscan(fid, '%n%n%n','commentStyle', '//')); fclose(fid) clear fid %% make overall pie chart all = fdata(:,2:3); figure plotWeatherPie(all(:),1,1) clear all %% morning / evening pie chart % find first entries for each day only dif = diff(fdata(:,1)); firsts = fdata(logical([1;dif>0]),2:3); fig = figure('Position',[144 204 748 364],... 'PaperPositionMode','auto'); subplot(1,2,1) plotWeatherPie(firsts(:,1),0,1) text(0.5,1.1,'morning','Units','normalized','HorizontalAlignment','center') subplot(1,2,2) plotWeatherPie(firsts(:,2),1) text(0.5,1.1,'evening','Units','normalized','HorizontalAlignment','center') saveas(fig,'e:\website\images\fahrradwetterstatistik','png') clear dif firsts fig %% sequence plot dif = diff(fdata(:,1)); firsts = fdata(logical([1;dif>0]),:); dayes = datenum(num2str(firsts(:,1)),'yyyymmdd'); firstday = dayes(1); dayes = dayes - dayes(1) + 1; ndps = dayes(end)-29; N = zeros(ndps,1); percents = zeros(4,2,ndps); for i = 1:ndps ind = find(dayes>=i & dayes