Not enough input arguments.

조회 수: 1 (최근 30일)
Stefania Rauta
Stefania Rauta 2021년 1월 5일
댓글: the cyclist 2021년 1월 6일
function P = Fillter(K)
dem=0;
%F=zeros(10001,2);
F(1,1)=K(1,1);
F(1,2)=K(1,2);
t=length(K(:,1));
for i=2:1:t
if (K(i,1)~=K(i-1,1))
F(i-dem,1)=K(i,1); F(i-dem,2)=K(i,2);
else
dem=dem+1;
end
end
P=F;
end
Line : F(1,1)=K(1,1); Not enough input arguments.
How to fix that?

채택된 답변

the cyclist
the cyclist 2021년 1월 5일
How are you calling the function? If you call it like this ...
Fillter()
then you will get that error because Fillter is expecting one input, and it is receiving zero inputs.
  댓글 수: 2
Stefania Rauta
Stefania Rauta 2021년 1월 6일
that's not the problem :(
the cyclist
the cyclist 2021년 1월 6일
You didn't answer the question, though. How are you calling the function? Can you upload a complete set of code we can run, that gives the error? Because if I call it as follows
Fillter([1 2 3 4])
then the code runs to completion with no error.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by