www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/WriteGrayscaleImagetoPNGExample.m

    %% Write Grayscale Image to PNG  

% Copyright 2015 The MathWorks, Inc.


%% 
% Write a 50-by-50 array of grayscale values to a PNG file in the current folder. 
A = rand(50);
imwrite(A,'myGray.png')