Not enought input arguements in line 2

조회 수: 1 (최근 30일)
Basmah Ahmad
Basmah Ahmad 2021년 12월 20일
답변: Walter Roberson 2021년 12월 20일
Why i am getting this error in line 2.
function dj=system_equation(X)
p0=X(1)
p1=X(2)
p2=X(3)
% Re
%j =(64071*p0*p1)/20 + (46251*p0*p2)/20 + (46251*p1*p2)/20 - (7648587*p0*p1^2)/560 - (7648587*p0^2*p1)/560 - (5727591*p0*p2^2)/560 - (7648587*p0^2*p2)/560 - (5727591*p1*p2^2)/560 - (7648587*p1^2*p2)/560 - (64071*p0^2*sin(2))/80 - (64071*p1^2*sin(2))/80 - (34911*p2^2*sin(2))/80 + (64071*p0^2)/40 + (64071*p1^2)/40 + (34911*p2^2)/40 + (135685287*p0^2*p1^2)/4480 + (135685287*p0^2*p2^2)/4480 + (135685287*p1^2*p2^2)/4480 + (214183359*p0*p1*p2^2)/2240 + (34086177*p0*p1^2*p2)/320 + (34086177*p0^2*p1*p2)/320 + (7648587*p0*p1^2*sin(2))/1120 + (7648587*p0^2*p1*sin(2))/1120 + (5727591*p0*p2^2*sin(2))/1120 + (7648587*p0^2*p2*sin(2))/1120 + (5727591*p1*p2^2*sin(2))/1120 + (7648587*p1^2*p2*sin(2))/1120 - (51386292513*p0*p1^2*p2^2)/246400 - (51386292513*p0^2*p1*p2^2)/246400 - (51386292513*p0^2*p1^2*p2)/246400 - (135685287*p0^2*p1^2*sin(2))/8960 - (135685287*p0^2*p2^2*sin(2))/8960 - (135685287*p1^2*p2^2*sin(2))/8960 - (4204953*p0*p1*p2)/112 - (64071*p0*p1*sin(2))/40 - (46251*p0*p2*sin(2))/40 - (46251*p1*p2*sin(2))/40 + (4665477549303*p0^2*p1^2*p2^2)/12812800 + (4204953*p0*p1*p2*sin(2))/224 - (4665477549303*p0^2*p1^2*p2^2*sin(2))/25625600 - (214183359*p0*p1*p2^2*sin(2))/4480 - (34086177*p0*p1^2*p2*sin(2))/640 - (34086177*p0^2*p1*p2*sin(2))/640 + (51386292513*p0*p1^2*p2^2*sin(2))/492800 + (51386292513*p0^2*p1*p2^2*sin(2))/492800 + (51386292513*p0^2*p1^2*p2*sin(2))/492800
dj(1) =(64071*p0)/20 + (64071*p1)/20 + (46251*p2)/20 - (7648587*p0*p1)/280 - (7648587*p0*p2)/280 - (4204953*p1*p2)/112 - (64071*p0*sin(2))/40 - (64071*p1*sin(2))/40 - (46251*p2*sin(2))/40 + (135685287*p0*p1^2)/2240 + (135685287*p0*p2^2)/2240 + (214183359*p1*p2^2)/2240 + (34086177*p1^2*p2)/320 + (7648587*p1^2*sin(2))/1120 + (5727591*p2^2*sin(2))/1120 - (7648587*p1^2)/560 - (5727591*p2^2)/560 - (51386292513*p1^2*p2^2)/246400 - (51386292513*p0*p1*p2^2)/123200 - (51386292513*p0*p1^2*p2)/123200 - (135685287*p0*p1^2*sin(2))/4480 - (135685287*p0*p2^2*sin(2))/4480 - (214183359*p1*p2^2*sin(2))/4480 - (34086177*p1^2*p2*sin(2))/640 + (4665477549303*p0*p1^2*p2^2)/6406400 + (51386292513*p1^2*p2^2*sin(2))/492800 + (34086177*p0*p1*p2)/160 + (7648587*p0*p1*sin(2))/560 + (7648587*p0*p2*sin(2))/560 + (4204953*p1*p2*sin(2))/224 - (34086177*p0*p1*p2*sin(2))/320 + (51386292513*p0*p1*p2^2*sin(2))/246400 + (51386292513*p0*p1^2*p2*sin(2))/246400 - (4665477549303*p0*p1^2*p2^2*sin(2))/12812800
dj(2) =(64071*p0)/20 + (64071*p1)/20 + (46251*p2)/20 - (7648587*p0*p1)/280 - (4204953*p0*p2)/112 - (7648587*p1*p2)/280 - (64071*p0*sin(2))/40 - (64071*p1*sin(2))/40 - (46251*p2*sin(2))/40 + (135685287*p0^2*p1)/2240 + (214183359*p0*p2^2)/2240 + (34086177*p0^2*p2)/320 + (135685287*p1*p2^2)/2240 + (7648587*p0^2*sin(2))/1120 + (5727591*p2^2*sin(2))/1120 - (7648587*p0^2)/560 - (5727591*p2^2)/560 - (51386292513*p0^2*p2^2)/246400 - (51386292513*p0*p1*p2^2)/123200 - (51386292513*p0^2*p1*p2)/123200 - (135685287*p0^2*p1*sin(2))/4480 - (214183359*p0*p2^2*sin(2))/4480 - (34086177*p0^2*p2*sin(2))/640 - (135685287*p1*p2^2*sin(2))/4480 + (4665477549303*p0^2*p1*p2^2)/6406400 + (51386292513*p0^2*p2^2*sin(2))/492800 + (34086177*p0*p1*p2)/160 + (7648587*p0*p1*sin(2))/560 + (4204953*p0*p2*sin(2))/224 + (7648587*p1*p2*sin(2))/560 - (34086177*p0*p1*p2*sin(2))/320 + (51386292513*p0*p1*p2^2*sin(2))/246400 + (51386292513*p0^2*p1*p2*sin(2))/246400 - (4665477549303*p0^2*p1*p2^2*sin(2))/12812800
dj(3) =(46251*p0)/20 + (46251*p1)/20 + (34911*p2)/20 - (4204953*p0*p1)/112 - (5727591*p0*p2)/280 - (5727591*p1*p2)/280 - (46251*p0*sin(2))/40 - (46251*p1*sin(2))/40 - (34911*p2*sin(2))/40 + (34086177*p0*p1^2)/320 + (34086177*p0^2*p1)/320 + (135685287*p0^2*p2)/2240 + (135685287*p1^2*p2)/2240 + (7648587*p0^2*sin(2))/1120 + (7648587*p1^2*sin(2))/1120 - (7648587*p0^2)/560 - (7648587*p1^2)/560 - (51386292513*p0^2*p1^2)/246400 - (51386292513*p0*p1^2*p2)/123200 - (51386292513*p0^2*p1*p2)/123200 - (34086177*p0*p1^2*sin(2))/640 - (34086177*p0^2*p1*sin(2))/640 - (135685287*p0^2*p2*sin(2))/4480 - (135685287*p1^2*p2*sin(2))/4480 + (4665477549303*p0^2*p1^2*p2)/6406400 + (51386292513*p0^2*p1^2*sin(2))/492800 + (214183359*p0*p1*p2)/1120 + (4204953*p0*p1*sin(2))/224 + (5727591*p0*p2*sin(2))/560 + (5727591*p1*p2*sin(2))/560 - (214183359*p0*p1*p2*sin(2))/2240 + (51386292513*p0*p1^2*p2*sin(2))/246400 + (51386292513*p0^2*p1*p2*sin(2))/246400 - (4665477549303*p0^2*p1^2*p2*sin(2))/12812800
%dj=[djdp0 djdp1 djdp2]
% dj2dp0=diff(djdp0,p0)
% dj2dp1=diff(djdp1,p1)
% dj2dp2=diff(djdp2,p2)

답변 (1개)

Walter Roberson
Walter Roberson 2021년 12월 20일
You are running the code without providing any input parameters.
You might be trying to run the code by pressing the green Run button.
Or you might possibly have coded something like
fsolve(system_equation, x0)
when you would instead have needed to code
fsolve(@system_equation, x0)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by