MATLAB: What is the meaning of ~ at fuction

at function ~ignoredinputoutputtilde

at 'Software-Analog Triggered Data Capture' document,
there's startCapture(hObject, ~, hGui) or endDAQ(~, ~, s)
What is the meaning of ~ at fuction?
I don't understand the meaning..
function startCapture(hObject, ~, hGui)
if get(hObject, 'value')
% If button is pressed clear data capture plot
for ii = 1:numel(hGui.CapturePlot)
set(hGui.CapturePlot(ii), 'XData', NaN, 'YData', NaN);
end
end
end
function endDAQ(~, ~, s)
if isvalid(s)
if s.IsRunning
stop(s);
end
end
end

Best Answer

MATLAB has positional function input and output arguments. This means their purpose is determined entirely by their position when the function is defined and called, not by their names (like in some other programming languages).
It is useful sometimes to ignore particular inputs/outputs, which is what the tilde ~ is for. When defining a function, the tilde ignores a particular input, e.g. using your example the first function has three input arguments, of which only one is used:
function endDAQ(~, ~, s)
% ^ 1st input is ignored
% ^ 2nd input is ignored
% ^ 3rd input is named 's'
vs. your second function which only has one input argument:
function endDAQ(s)
% ^ 1st input is named 's'
Read more:
Related Question