MATLAB: Unexplainable (to me) “not enought input arguments error”

errorfunction

Hello I am making a code that takes data and remove outliers, the data are read from a excel file, here is the code if true % code
function filtered=filter(vec)
%Contador para almacenar los datos del vector procesado
clear all
%%vec=xlsread('datos lab 4.xls','Hoja2','Q6:S2005');
i=1;
filtered(1,:)=vec(1,:);
i=i+1;
for j=2:length(vec(:,1))
if abs((vec(j,2)-vec(j-1,2))/vec(j-1,2))<1
filtered(i,:)=vec(j,:);
i=i+1;
end
end
end
end
The problem is when I try to call the function externally with the data (the line that reads the data is commented), I try uncommenting this line and modifying the code to turn it in a script and it works !!, but when I use It with exactly the same data in another script or the command line it says "not enought input argumentes"

Best Answer

How are you calling it on the command line? Did you first call xlsread to get "vec" and then say
filtered = filter(vec);
By the way, filter() is the name of a built-in function, so how do you know which version of filter function you're calling? Why don't you call your function something different?