y''-y' y=sin(x) +exp(x)

1 view (last 30 days)
thang phung
thang phung on 27 Dec 2017
Commented: Star Strider on 28 Dec 2017
I do not know how to solve it if I do not use dsolve
  5 Comments
thang phung
thang phung on 27 Dec 2017
why they're so different ?

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 27 Dec 2017
They are different because odeToVectorField gives you an array you can pass to matlabFunction that will give you an anonymous function you can use directly with ode45 (if you write the matlabFunction call correctly), to get a numeric solution.
The result of your dsolve call gives you the analytic solution to the differential equation.
They are two entirely different results.
  4 Comments
thang phung
thang phung on 27 Dec 2017
thank you so much
Star Strider
Star Strider on 28 Dec 2017
As always, my pleasure.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!