MATLAB: Regarding length of an image.

image

length (srcfile);
Here, srcfile is an image. the previous line determines the length of an image but I don't understand what can be the length of an image!!
Can anyone help me please to understand it.
Thanks

Best Answer

From Matlab point of view, an image is a matrix (sometimes a 3D matrix). if Im is the matrix containing your image,
length(Im)
will return the number of columns of the image matrix.
size(Im)
returns both rows and columns.