Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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]);
>>

Respuesta aceptada

DGM
DGM el 12 de Feb. de 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 comentarios
Image Analyst
Image Analyst el 12 de Feb. de 2022
If that solved your problem, you can thank @DGM by clicking the "Accept this answer" to award @DGM reputation points. Thanks in advance. 😊

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by