options=odeset(‘RelTol’,1.0e-5);
[t,x]=ode23(@f,[0 4],0.5,options);
plot(t,x,’ko-‘)
xlabel(‘t’,’fontsize’,16);
ylabel(‘x(t)’,’fontsize’,16);
function dxdt=f(t,x)
dxdt=10*exp(-(t-2)^2/(2*0.075^2))-0.6*x;
end
options=odeset(‘RelTol’,1.0e-5);
[t,x]=ode23(@f,[0 4],0.5,options);
plot(t,x,’ko-‘)
xlabel(‘t’,’fontsize’,16);
ylabel(‘x(t)’,’fontsize’,16);
function dxdt=f(t,x)
dxdt=10*exp(-(t-2)^2/(2*0.075^2))-0.6*x;
end