In MATLAB help it is stated that
[tf, loc] = ismember(A, S, ...) returns an array loc containing the highest index in S for each element in A that is a member of S. For those elements of A that do not occur in S, ismember returns 0.
According to the statement above, in your case:
tf will be equal to 1 if there exist a row in SEP that is equal to S(i,: ), and 0 otherwise.
loc will be the index of the row of SEP which is equal to S(i,: )
For example:
if SEP = [1 2 3; 4 5 6; 7 8 9] and S(i,: ) =[4 5 6]
then loc will be equal to 2, because the 2nd row of SEP is equal to S(i,: ).
if S(i,: ) = [7 8 9] then loc will be 3, because the 3rd row of SEP is equal to S(i,: ).
And as for the logical value "tf"
You need to use it because the ismember() function doesn't have any prototype which returns only the index (i.e. loc).
It returns either only tf, or both tf and loc. So in order to get the index, you have to get the logical value also, even though you won't be using it.
If you still can't understand it, then debug your code and see the values these two variables take.