In versions of MATLAB since 2009, you can use the tilde ( ~ ) to ignore outputs you don't need . If this gives you an error, it means that your version does not support this use of the tilde, and you should replace it with the name of a dummy variable as follows:
[MN dummy] = size(imge);
As Sumon explains, M will contain the number or rows in the image and N will be the number of columns; the dummy will be 1 (for one black-and-white image), 3 (for one color image) or an arbitrary integer (for the image stack).
Usually it makes sense to use a tilde if after that there are other parameters that are of interest to you. size is an exception here when it checks (using nargout ) the number of outputs it needs to produce, and accordingly changes its behavior as described here. .
I.e
test = zeros(3,4,5); [MN dummy] = size(test);
produces M = 3, N = 4, as one would expect, but
test = zeros(3,4,5); [MN] = size(test);
produces M = 3, N = 20.
In your particular case, I assume that imge is a stack of images, and the programmer wanted to know the size of the individual images, but not how many there are.
source share