Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Why isn't working?
1 回表示 (過去 30 日間)
古いコメントを表示
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)
1 件のコメント
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!