The subaxis function on the File Exchange allows you to specify margins for subplots.
Example usage:
t = 0:0.001:2*pi+0.001;
figure(2);
for i = 1 : 25;
subaxis(5,5,i, 'Spacing', 0.03, 'Padding', 0, 'Margin', 0);
plot(t, sin(i*t));
axis tight
axis off
end
