Info

This question is closed. Reopen it to edit or answer.

Why isn't working?

1 view (last 30 days)
Luis Montenegro
Luis Montenegro on 3 Sep 2020
Closed: Walter Roberson on 3 Sep 2020
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)

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!