function result = inImage (s,x,y)
if x > 0 && y > 0
    if x <= s(2) && y <= s(1)
        result = 1;
        return;
    end
end
result = 0;