function ans = search(v, value) %% ans = search(v, value) index = 1; notfound = true; ans = []; while notfound && (index <= length(v)) item = v(index); if item == value ans = item; notfound = false; end index = index + 1; end