Q:

matlab inline function with special handling for zero

I have a function that has a singularity at zero. The resulting value should be at that point 1.
However I fails to understand how to create an inline function that has a special treatment for values of x and y at x or y = 0.
The function could for example be 
f = @(x,y) ( 1./x + 1./y ); 

A:

To answer your question with a counter-question: why do you want it to be inline? 
As a general rule, keep inline functions simple. If more functionality is needed, use a dedicated function:
function val = f(x,y)

    if ~all(size(x)==size(y))
        error('sizes must match');

    val = zeros(size(x));

    zero_x = x==0;
    zero_y = y==0;

    not_zero = ~zero_x & ~zero_y;
    zero = ~not_zero;

    val(not_zero) = 1./x(not_zero) + 1./y(not_zero);
    val(zero) = 1;           

end

Having said that, there are of course ways to do it inline (see other answers). 
But as you indicated, your actual function is more complex, so...why inline? 

