채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 5일

0 개 추천

You can define it in the ODE function
IC = 0; % initial conditions
tspan = [0 10]; % initial conditions
ode45(@odefun, tspan, IC)
function dxdt = odefun(t, x)
if x < 0
dxdt = -x;
else
dxdt = x.^2;
end
end

추가 답변 (0개)

카테고리

태그

질문:

2020년 10월 5일

답변:

2020년 10월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by