handle = figure;
Position = get(handle, 'Position');
set(handle,'PaperPositionMode','auto');
%该图片会被保存为566*550大小的图片
set(handle,'Position',[Position(1:2),566,550]);
%利用plot绘图
x1 = 0.01 : 0.01 : n*pi;
y1 = sin(x1) ./x1;
x2 = -n*pi : 0.01 : -0.01;
y2 = sin(x2)./x2;
y = [y2 y1];
x = [x2 x1];
plot(x,y);
%保存图片为test.jpg
print(handle,'-djpeg','-r0','test.jpg');
更多内容请参考:http://www.mathworks.cn/matlabcentral/newsreader/view_thread/244905