Am using the function ode45 to solve a differential equations with IVP, Is it possible to set the tspan in a range [-5:0.5:5] and use an initial value at the point zero => y(0)= 1.
Am trying to graph the result from start of range to end [-5,5]. this What I have come up with so far
f = @(x, y) sin(y);
y0 = -1.5;
tspan = [-5:0.5:5];
[ts,ys] = ode45(f, tspan, y0); plot(ts, ys);
© 2016 Powered by mzan.com design MATCHINFO