I am using a function with multiple outputs in Matlab, but am only interested in one of the outputs. I would like to suppress the other output variables (i.e. avoid them bei
Replace any output variables you don't want with a ~ character.
E.g.
[~,I] = max(matrix);
This pattern has an advantage over clear in that the MATLAB interpreter and just-in-time compiler can avoid the memory and CPU costs of calculating ignored variables.
Edit
Here is the documentation and a blog post by Loren Shure on this use of ~. I can't find any definite information about use of ignored variables for eliminating unnecessary computation.