In MATLAB, what does the following code do:
[m, ~]=func_returning_matrix()
What does the tilde operator, ~, do?
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_matrix returns 2 arguments, the expression will assign the first to the variable m and forget the second. If func_returning_matrix returns 3 (or more) arguments, then the expression will drop the second and all later outputs from the function.
func_returning_matrix
m
1.4m articles
1.4m replys
5 comments
57.0k users