How do I solve this differential equation with MATLAB?

2 visualizzazioni (ultimi 30 giorni)
Hi yall!
I'm wondering how to get the solution for "dy/dx = x^2 - 1" in MATLAB using dsolve with initial condition y(0) = 1. I want to know and see all the MATLAB work for when x = 1 and when x = 2. I'm familiar with dsolve but I want to see how to use it correctly. Please help me.

Risposte (1)

Walter Roberson
Walter Roberson il 3 Ott 2019
Modificato: Walter Roberson il 3 Ott 2019
syms y(x)
dy = diff(y(x),x);
eqn = dy == Some Function Of x and y
sol = dsolve(eqn, y(0) == Initial Condition)
subs(sol, x, Some Value)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by