MATLAB: Using if statement inside a function,I didn’t understand why the error is coming,why I am unable to use the values of x & y inside the if loop

if statement

function O = help(~,~)
i=input('Value of i:');
j=input('Value of j:');
O = y(i,j);
function g=y(x,y)
if(x==y)
{
k = rem(x,2);
s = log2( (y - k) );
g = 2^(-s);
}
else
{
g=0;
}
end
return;
end
return;
end

Best Answer

Curly braces for the if-else statement are not required.