File 'ode1' not found.

조회 수: 4 (최근 30일)
Zouhir Bensebban
Zouhir Bensebban 2018년 6월 14일
댓글: Walter Roberson 2023년 10월 8일
Hi guys, if I type this (type ode1) I'm going to make these mistakes! Error using type File 'ode1' not found. why? Thanks

답변 (2개)

Walter Roberson
Walter Roberson 2018년 6월 15일

Alvin
Alvin 2023년 10월 8일
You can create one yourself, then you can type it.
function [yout] = ode1(F, t0, h, tfinal, y0)
% ODE1 is a simple ODE solver.
% dy/dt = F(t, y) with y(t0) = y0
y = y0;
yout = zeros((tfinal-t0)/h+1, 1); yout(1) = y0;
for t = t0+h : h : tfinal
s = F(t, y); % Slope
y = y + h * s; % from y(t) to y(t+h)
yout(round((t-t0)/h+1)) = y; % list of y's are recorded
end
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2023년 10월 8일
You can, but in my answer I linked to some pre-written fixed-step ODE solvers supplied by Mathworks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by