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

1 vue (au cours des 30 derniers jours)
nune pratyusha
nune pratyusha le 12 Fév 2022
Commenté : Image Analyst le 12 Fév 2022
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]);
>>

Réponse acceptée

DGM
DGM le 12 Fév 2022
[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 commentaires
nune pratyusha
nune pratyusha le 12 Fév 2022
thank you sir
Image Analyst
Image Analyst le 12 Fév 2022
If that solved your problem, you can thank @DGM by clicking the "Accept this answer" to award @DGM reputation points. Thanks in advance. 😊

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by