matlab图像保存

用matlab保存图像,主要由以下几个函数;

1 从菜单保存

可以保存为fig,eps,jpeg,gif,png,bmp等格式。

2 复制粘贴

edit------〉copy figure,再粘贴到其他程序。

3 saveas函数

saveas(gca,filename,fileformat)

4 print

  1. minbnd = -4*pi;  
  2. maxbnd = 4*pi;  
  3. t = minbnd:0.1*pi:maxbnd;  
  4. plot(t, sin(t), 'g', 'Linewidth', 2);  
  5. line([minbnd, maxbnd], [0, 0]);    %绘制x轴  
  6. axis([-10, 10, -2, 2])             %定义显示的坐标区间:x在(-10,10)之间,y在(-2,2)之间  
  7. grid on;  
  8. title('sin(x)');  
  9. xlabel('x');  
  10. ylabel('sin(x)');  
  11. print('-dpng','sin.png');          %保存为png图片,在Matlab当前的工作目录下  

保存格式:推荐bmp格式,保存后图像的像素值会保持不变

你可能感兴趣的:(matlab,图像保存)