MATLAB: I need help with this trivial function.

errorfibonacciMATLAB

I'm trying to run this script but I keep getting this error mensage:
??? Input argument "x" is undefined.
Error in ==> fibonacci at 8
Could anybody help me? Here is the code:
function y = fibonacci(x)
if x == 0
y = 0
elseif x == 1
y = 1
else
y = fibonacci(x-1) + fibonacci(x-2)
end

Best Answer

This isn't a script, it's a function. You need to pass input argument while calling the function.
x = 4 ;
y = fibonacci(4) or fibonacci(x);