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: