Not enough input arguments

조회 수: 4 (최근 30일)
Daniel
Daniel 2023년 3월 15일
편집: Askic V 2023년 3월 16일
Hi there,
I need some help figuring out why I keep getting a "Not enough input arguments" error for the following code.
Thanks in advance
Here is the error message:
Not enough input arguments.
Error in functionhandle>@(x,y)x.*y+10*sin(x).*cos(y) (line 32)
f = @(x,y) x.*y + 10*sin(x).*cos(y);
  댓글 수: 2
Bhanu Prakash
Bhanu Prakash 2023년 3월 15일
Hi Daniel,
Can you post the complete code, so that the error can be understood clearly?
Askic V
Askic V 2023년 3월 15일
편집: Askic V 2023년 3월 16일
You didn't post the relevant code. Most probably this line
f = @(x,y) x.*y + 10*sin(x).*cos(y);
is inside the function and you're trying to execute function as a script i.e. just pressing the green play button in the editor.

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

답변 (1개)

KSSV
KSSV 2023년 3월 15일
f = @(x,y) x.*y + 10*sin(x).*cos(y);
x = linspace(0,2*pi) ;
y = linspace(0,2*pi) ;
[X,Y] = meshgrid(x,y) ;
Z = f(X,Y) ;
surf(X,Y,Z)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by