What does this statement mean???
[M N ~] = size(imge);
I don’t understand the reason to use this “~”, and this statement also gives an error message.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In MATLAB versions since 2009b, you can use the tilde (
~) to ignore outputs which you don’t need. If it gives you an error, that means your version doesn’t support this use of the tilde and you have to replace it with a dummy variable name as so:As Sumona explains, M will contain the number or rows in the image and N the number of columns; dummy will be 1 (for one black-and-white image), 3 (for one colour image) or an arbitrary integer (for an image stack).
Usually it only makes sense to use the tilde if there are other parameters you are interested afterwards.
sizeis an exception here in that it checks (usingnargout) how many outputs it should produce and changes its behavior accordingly, as documented here..That is,
produces M=3,N=4 as one would expect, but
produces M=3,N=20.
In your particular case, I assume
imgeis an image stack and the programmer wanted to find out the size of the individual images, but not how many there are.