필터 지우기
필터 지우기

How can I fix "Not Enough Input Arguments" error in this Script?

조회 수: 17 (최근 30일)
Tom Keaton
Tom Keaton 2018년 6월 20일
답변: KSSV 2018년 6월 21일
Input:
t = 0:pi/50:10*pi;
x = (1/2)*(sin(2*t))+1;
y = (1/2)*(cos(2*t))+1;
z = 2*t;
plot3(x,y,z,t,'r','LineWidth',3)
Output:
Error using plot3
Not enough input arguments.
Error in testfunc (line 6)
plot3(x,y,z,t,'r','LineWidth',3)
  댓글 수: 11
OCDER
OCDER 2018년 6월 21일
@Tom, glad it worked!
@Greg, I guess that explains why Mathworks put that error message. But, "Incorrect number of input arguments" INCLUDES "Not enough input arguments" AND "Too many input arguments". In this case, there was too many input arguments, which was the opposite of "not enough input arguments" - this could make debugging a little confusing.
Greg
Greg 2018년 6월 21일
Maybe you're right. Personally, MATLAB's documentation makes 100% perfect sense to me, so I just look up the calling syntax and fix it. It's probably the single most prominent reason I'm proficient with MATLAB - my brain just works exactly the way the documentation is laid out. Others might not be so lucky.

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

답변 (1개)

KSSV
KSSV 2018년 6월 21일
t = 0:pi/50:10*pi;
x = (1/2)*(sin(2*t))+1;
y = (1/2)*(cos(2*t))+1;
z = 2*t;
plot3(x,y,z,'r','LineWidth',3)
You need not plot t here. plot3 takes only three inputs of data i.e (x,y,z).

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by