i am getting not enough input arguments error for the below code

조회 수: 1 (최근 30일)
nune pratyusha
nune pratyusha 2022년 2월 12일
댓글: Image Analyst 2022년 2월 12일
function dx = m(t,x)
dx=zeros(4,1);
dx(1) = -(1/(8200*47*1e-9))*x(2);
dx(2) = (((x(3)-x(2))/2000) -(0.667e-3 + 0.029e-3*x(1).*x(1)*3.*x(2)))/6.8e-9;
dx(3) = ((x(2)-x(3))/2000 - x(4))/68e-9;
dx(4) = x(3)/18e-3;
[t,x] = ode15s(m,[0 50],[0 0.11 0.11 0]);
plot(x(:,2),x(:,3))
my error is like
Not enough input arguments.
Error in m (line 4)
dx(1) = -(1/(8200*47*1e-9))*x(2);
Error in untitled4 (line 3)
[t,x] = ode15s(m,[0 50],[0 0.11 0.11 0]);
>>

채택된 답변

DGM
DGM 2022년 2월 12일
[t,x] = ode15s(@m,[0 50],[0 0.11 0.11 0]);
plot(x(:,2),x(:,3))
function dx = m(t,x)
dx=zeros(4,1);
dx(1) = -(1/(8200*47*1e-9))*x(2);
dx(2) = (((x(3)-x(2))/2000) -(0.667e-3 + 0.029e-3*x(1).*x(1)*3.*x(2)))/6.8e-9;
dx(3) = ((x(2)-x(3))/2000 - x(4))/68e-9;
dx(4) = x(3)/18e-3;
end
  댓글 수: 2
Image Analyst
Image Analyst 2022년 2월 12일
If that solved your problem, you can thank @DGM by clicking the "Accept this answer" to award @DGM reputation points. Thanks in advance. 😊

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by