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