Generate graph in Matlab
clear all;
load('results.txt');
time = results(:,3) - 1238370000;


There's no need to plot all of the points if you're going to restrict the range to the past week. So I'd suggest you find the index where the time is less than a week ago and limit your plotting to that period to reduce complexity

firstTimeIndex = find(time &gt;= (max(time) - 86400*7), 1);


Also note that you can use 'end' instead of 'size(results,1)'

results = results(max(1,firstTimeIndex-1):end, :);
clf;
h = plot(time,smooth(results(:,1)),':b');
hold on;


Line properties like linewidth can be specified at the time of plotting

plot(time, smooth(results(:,4)), 'r', 'linewidth', 2);
plot(time, smooth(results(:,5)), 'g', 'linewidth', 2);
plot(time, smooth(results(:,6)), 'm', 'linewidth', 2);
xlabel('Time');
ylabel('Emails');
xlim([max(time)-(86400*7) max(time)-1]);
ylim([0 80]);
set(gca,'XGrid','on');
set(gca,'XTickLabel',['Mon';'Tue';'Wed';'Thu';'Fri';'Sat';'Sun']);
title('Size of inbox over time (seven days)');


I'm not sure why you are setting the resolution to 3000 dpi? Maybe you could elaborate on what you're using this for, but if your goal is high resolution and low storage size then you might like to use -dmeta for a metafile on windows, or -deps for an encapsulated postscript on unix

print -djpeg inbox7day.jpeg;


I'm not sure what you are trying to achieve with the 'XTick' property, but the vector you're passing in is extremely large (~100 million elements) which is why the code is running so slow. I'm guessing that you don't want 100 million ticks?