Convert syms struct to numerical values

2 vues (au cours des 30 derniers jours)
JC.UT
JC.UT le 21 Sep 2021
Commenté : KSSV le 21 Sep 2021
I need to add in initial condition (x,y)=(1,1). The solution, S will yield struct with fields. I'm trying to convert them to numerical values in order to plot directional fields. How do I use subs or double to convert them , I'm having a difficult time using documentation to solve this one.
syms x(t) y(t)
ode1=diff(x)==2*x+y;
ode2=diff(y)==x+y;
cond=;
odes=[ode1 ode2 cond];
S=dsolve(odes)
S =
struct with fields:
y: [1×1 sym]
x: [1×1 sym]
  1 commentaire
KSSV
KSSV le 21 Sep 2021
Read about subs and double.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Formula Manipulation and Simplification dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by