Not enough input arguments

I get this error for a simple code
function f = fun(x)
f =2*x;
end
please help me

 Accepted Answer

You have to call your function as:
x = 42;
y = fun(x);
Simply using the ‘Run’ option by clicking the green arrow in the Editor will not work.

More Answers (0)

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!