답변 (2개)

Steve Areola
Steve Areola 2023년 8월 5일

0 개 추천

clc
a=0;b=2;N=10; alph=0.5;
h=(b-a)/N; t(1)=a; w(1)=alph;
f = @(t,y) y-t^2+1;
for i=2:N+1
t(i)=a+(i+1)*h;
w(i)=w(i-1)+h*f(t(i-1),w(i-1));
end
disp("t w")
x=[t;w];
fprintf("%5.9f %5.9f\n",x)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2021년 1월 13일

답변:

2023년 8월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by