Unexplainable (to me) "not enought input arguments error"
1 view (last 30 days)
Show older comments
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"
0 Comments
Accepted Answer
Image Analyst
on 3 May 2013
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?
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!