function z=smallestGreater(x,y)

%Input x is an ascending array
%Input y is a scalar
%This function finds the smallest value in x that is greater than y.

for tmp=x'
    if tmp>y
        z=tmp;
        return
    end
end

z=[];
end