i want to calculate the solution of the following cauchy problem :
y'(t)=1+t-y(t) t in[0,1]
but i have this error can anyone help me:
FZERO cannot continue because user supplied function_handle ==>
@(x)dot(a,y(i:-1:i-p))+h*dot(b(1:end-1),f(t(i:-1:i-p),y(i:-1:i-p)))-x+h*b(end)*f(t(i+1),x) failed
with the error below.
Matrix dimensions must agree.
Error in adamsMp2o3 (line 14)
y(i+1)=fzero(@(x)dot(a,y(i:-1:i-p))+h*dot(b(1:end-1),f(t(i:-1:i-p),y(i:-1:i-p)))-x+h*b(end)*f(t(i+1),x),y(i));
Error in ppadamasmoultonordre3 (line 26)
[t,y]=adamsMp2o3(a,b,f,y0,t,n,af,h)
[t,y]=adamsMp2o3(a,b,f,y0,t,n,af,h)
function [t,y]=adamsMp2o3(a,b,f,y0,t,n,af,h)
k2=f(t(1)+h/2,y(1)+(h/2)*k1);
k3=f(t(1)+h/2,y(1)+(h/2)*k2);
y(2)=y(1)+(h/6)*(k1+2*k2+2*k3+k4);
y(i+1)=fzero(@(x)dot(a,y(i:-1:i-p))+h*dot(b(1:end-1),f(t(i:-1:i-p),y(i:-1:i-p)))-x+h*b(end)*f(t(i+1),x),y(i));