It is the first time I try to define a function in Matlab and it doesnt seem to work, The error I am getting is not enough input argument .To make it simple I opened a new function and copied the second example from the documentation for defining functions(<http://www.mathworks.com/help/matlab/ref/function.html)>, clicked F5 and saved under stat. The message on the command window : ">> stat Error using stat (line 2) Not enough input arguments."
function [m,s] = stat(x)n = length(x);m = sum(x)/n;s = sqrt(sum((x-m).^2/n));end
I use Matlab R2013a
Best Answer