In MATLAB, what does the following code do:
[m, ~]=func_returning_matrix()
What does the tilde operator, ~, do?
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 it means don’t assign the corresponding output argument(s) from the function on the rhs of the assignment. So, if
func_returning_matrixreturns 2 arguments, the expression will assign the first to the variablemand forget the second. Iffunc_returning_matrixreturns 3 (or more) arguments, then the expression will drop the second and all later outputs from the function.