I have to found the solution of this differential equation: y'=-2-y^2, it look simple but I didn't think so. After solving the differential eqaution I have to plot the solution.
What I do:
function DY=solution(t,y)
DY=$-2-y^2$;
end
$[t,y]=ode45(@solution, [0, 4], 0)$; %% I have this message
Warning: Failure at $t=1.110695e+00$. Unable to meet integration tolerances without reducing the step size below the smallest value allowed $(3.552714e-15)$ at time $t$.
In $ode45$ at $309$
%% $[t,y]=ode45(@solution, [0, 4], 0)$ I get an array of numerical solution
%% in both cases the solution plotted give something not good
plot$(t,y)$[solution figure]1