What does it mean when ~ is used as one of the outputs for a function?
Show older comments
I have seen a few scripts where ~ is used as one of the output variables for a function/command? What is this supposed to mean and how is it useful? For example, in one of the lines for the script for the function divergence.m, I find the line [px, ~] = gradient(u);
Accepted Answer
More Answers (1)
LauraLee Austin
on 28 Oct 2016
2 votes
It indicates that you are not using that output variable.
[FX,FY] = gradient(F)
Let's say you wanted the FY variable but not FX:
[~,FY] = gradient(F)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!