% to read a image we need to call imshow function
I=imshow('lina.jpg')
% I is the image matrix
% lina.jpg is the image that you want to read, must keep in the current
% directories.
%DescriptionThe imread function supports four general syntaxes, described below. The imread function also supports several
%other format-specific syntaxes. See Special Case Syntax for information about these syntaxes.
%A = imread(filename,fmt) reads a greyscale or color image from the file specified by the string filename,
%where the string fmt specifies the format of the file. If the file is not in the current directory or in a
%directory in the MATLAB path, specify the full pathname of the location on your system. For a list of all the possible
%values for fmt, see Supported Formats. If imread cannot find a file named filename, it looks for a file named filename.fmt.
%imread returns the image data in the array A. If the file contains a grayscale image, A is a two-dimensional (M-by-N) array.
%If the file contains a color image, A is a three-dimensional (M-by-N-by-3) array. The class of the returned array depends on
%the data type used by the file format. See Class Support for more information. For most file formats, the color image data returned
%uses the RGB color space. For TIFF files, however, imread can return color
%data that uses the RGB, CIELAB, ICCLAB, or CMYK color%
%spaces. If the color image uses the CMYK color space, A is an M-by-N-by-4 array. See the TIFF-Specific Syntax for more information.
%[X,map] = imread(filename,fmt) reads the indexed image in filename into X and its associated colormap into map. The colormap values
%are rescaled to the range [0,1]. [...] = imread(filename) attempts to infer the format of the file from its content. [...] = imread(URL,...)
% reads the image from an Internet URL. The URL must include the protocol type (e.g., http://).
%values for fmt, see Supported Formats. If imread cannot find a file named filename, it looks for a file named filename.fmt.
%imread returns the image data in the array A. If the file contains a grayscale image, A is a two-dimensional (M-by-N) array.
%If the file contains a color image, A is a three-dimensional (M-by-N-by-3) array. The class of the returned array depends on
%the data type used by the file format. See Class Support for more information. For most file formats, the color image data returned
%uses the RGB color space. For TIFF files, however, imread can return color
%data that uses the RGB, CIELAB, ICCLAB, or CMYK color%
%spaces. If the color image uses the CMYK color space, A is an M-by-N-by-4 array. See the TIFF-Specific Syntax for more information.
%[X,map] = imread(filename,fmt) reads the indexed image in filename into X and its associated colormap into map. The colormap values
%are rescaled to the range [0,1]. [...] = imread(filename) attempts to infer the format of the file from its content. [...] = imread(URL,...)
% reads the image from an Internet URL. The URL must include the protocol type (e.g., http://).
% I is the image matrix
% lina.jpg is the image that you want to read, must keep in the current
% directories.
%DescriptionThe imread function supports four general syntaxes, described below. The imread function also supports several
%other format-specific syntaxes. See Special Case Syntax for information about these syntaxes.
%A = imread(filename,fmt) reads a greyscale or color image from the file specified by the string filename,
%where the string fmt specifies the format of the file. If the file is not in the current directory or in a
%directory in the MATLAB path, specify the full pathname of the location on your system. For a list of all the possible
%values for fmt, see Supported Formats. If imread cannot find a file named filename, it looks for a file named filename.fmt.
%imread returns the image data in the array A. If the file contains a grayscale image, A is a two-dimensional (M-by-N) array.
%If the file contains a color image, A is a three-dimensional (M-by-N-by-3) array. The class of the returned array depends on
%the data type used by the file format. See Class Support for more information. For most file formats, the color image data returned
%uses the RGB color space. For TIFF files, however, imread can return color
%data that uses the RGB, CIELAB, ICCLAB, or CMYK color%
%spaces. If the color image uses the CMYK color space, A is an M-by-N-by-4 array. See the TIFF-Specific Syntax for more information.
%[X,map] = imread(filename,fmt) reads the indexed image in filename into X and its associated colormap into map. The colormap values
%are rescaled to the range [0,1]. [...] = imread(filename) attempts to infer the format of the file from its content. [...] = imread(URL,...)
% reads the image from an Internet URL. The URL must include the protocol type (e.g., http://).
%values for fmt, see Supported Formats. If imread cannot find a file named filename, it looks for a file named filename.fmt.
%imread returns the image data in the array A. If the file contains a grayscale image, A is a two-dimensional (M-by-N) array.
%If the file contains a color image, A is a three-dimensional (M-by-N-by-3) array. The class of the returned array depends on
%the data type used by the file format. See Class Support for more information. For most file formats, the color image data returned
%uses the RGB color space. For TIFF files, however, imread can return color
%data that uses the RGB, CIELAB, ICCLAB, or CMYK color%
%spaces. If the color image uses the CMYK color space, A is an M-by-N-by-4 array. See the TIFF-Specific Syntax for more information.
%[X,map] = imread(filename,fmt) reads the indexed image in filename into X and its associated colormap into map. The colormap values
%are rescaled to the range [0,1]. [...] = imread(filename) attempts to infer the format of the file from its content. [...] = imread(URL,...)
% reads the image from an Internet URL. The URL must include the protocol type (e.g., http://).