chapra problem 25.7 (solving ode with euler method)
显示 更早的评论
I want to make a code to solve the problem in the image ,but when i run the program i get the following errors and i can not understand the mistake,if anyone can help me to understand my code problem .

My code
function [t,y,z] =p25_7(f1,f2,t1,t2,y0,z0,h)
t=t1:h:t2;
t =t';
n=length(t);
y=zeros(n,1);
z=zeros(n,1);
y(1)=y0;
z(1)=z0;
for i=1:n-1
y(i+1) = y(i) + f1(t(i) , y(i))*h ;
z(i+1) = z(i) + f2(y(i) , z(i))*h ;
end
command window

采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!