Q:

Tilde character in the brackets

In MATLAB, what does the following code do:
[m, ~]=func_returning_matrix()

What does the tilde operator, ~, do?

A:

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.

