필터 지우기
필터 지우기

Why am I getting "Not enough input arguments" error

조회 수: 1 (최근 30일)
David Miller
David Miller 2016년 6월 5일
댓글: David Miller 2016년 6월 5일
I am running my_driver which calls bugs_shape function in another .m file and this is the error I get:
>> run my_driver
Not enough input arguments.
Error in bugs_shape (line 39)
vel(:, k) = proj(angles(k,1))*direction;
Error in my_driver (line 51)
[posFinal, min_dist] =
bugs_shape(options, prams, posInit,
angles);
Error in run (line 96)
evalin('caller', [script ';']);
vel array is a 2xN array, proj is a function that takes an angle as an argument an returns a 2x2 array and direction is a 2x1 array.
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 6월 5일
We need to see your function declaration for bugs_shape and we need to see your function definition for proj
David Miller
David Miller 2016년 6월 5일
function [posFinal, min_dist] = bugs_shape(options, prams, posInit, theta, angles)
function f = eqn(theta);
f = 1 + 0.2*cos(5*theta);
end
function f = r1(theta);
f = (1 + 0.2*cos(5*theta))*cos(theta);
end
function f = r2(theta);
f = (1 + 0.2*cos(5*theta))*sin(theta);
end
function f = dr1(theta);
f = -1*(sin(5*theta)*cos(theta) + sin(theta)*(1+0.2*cos(5*theta)));
end
function f = dr2(theta);
f = (1+0.2*cos(5*theta))*cos(theta) - sin(5*theta)*sin(theta);
end
function f = proj(theta);
f = (1/(dr1(theta)^2+dr2(theta)^2))*...
[dr1(theta)^2 dr1(theta)*dr2(theta); dr1(theta)*dr2(theta) dr2(theta)^2];
end
...

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

채택된 답변

Walter Roberson
Walter Roberson 2016년 6월 5일
You missed the theta parameter when you call bugs_shape

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scope Variables and Generate Names에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by