フィルターのクリア

return column vector (t(i+1) & y(i+1)) instead of row vector

2 ビュー (過去 30 日間)
ken
ken 2022 年 4 月 3 日
回答済み: Walter Roberson 2022 年 4 月 3 日
function [y,t] = euler_timestep(f,t0,tf,alpha,N)
h=(tf-t0)/N;
t(1)=t0;
y(1)=alpha;
for i=1:N
t(i+1)=t(i)+h;
y(i+1)=y(i)+h*f(t(i),y(i));
end

採用された回答

Walter Roberson
Walter Roberson 2022 年 4 月 3 日
t = zeros(N+1,1);
y = zeros(N+1,1);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by