Info

此问题已关闭。 请重新打开它进行编辑或回答。

Why isn't working?

1 次查看(过去 30 天)
Luis Montenegro
Luis Montenegro 2020-9-3
关闭: Walter Roberson 2020-9-3
Hi, I've been trying all day trying to make my code work, but I can't get to the problem. The error or errors I get are "not enough input arguments" and an error on line 8 (T = T0...). Please help me
Here's the function code and the main code
function dxdt = funcionVel(t,x)
M = 1200;
r = 0.25;
c = 20;
T0 = 1000;
t0 = 10;
T = T0*(1 - exp(-t/t0));
dxdt(1) = x(2);
dxdt(2) = T/(M*r) - c*x(2);
dxdt = dxdt';
end
%main code:
clear variables
clc
t = (0:0.1:10);
condInicio = [0;0;0];
[T,Y] = ode45(@funcionVel,t,condInicio);
x1 = Y(:,1);
plot(t,x1)

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by