Illustration of Logical vectors:
Calling the function appears to return similar vector as simply vec > 5, and summing the result still works to determine how many elements were greater than 5.
>> notlog = testvecgtn(vec,5)
0 1 0 0 1 1
Though, as before, it could not be used to index a vector as the elements are double, and not logical:
??? Subscript indices should either be real positive integers or logical.