Error input must be floats, namely single or double.

tspan=[0:0.25:5];
syms x(t) m f_0
dx=diff(x)
x0=0;
ode=m*dx+k*x==f_0*sin(t)
[t,x]=ode45(@(t,x) ode,tspan,x0)
plot(t,x,'m')

 Respuesta aceptada

Walter Roberson
Walter Roberson el 8 de Jul. de 2018

0 votos

Look at the documentation odeFunction for information on how to convert symbolic ode to numeric.

Más respuestas (0)

Productos

Versión

R2017a

Etiquetas

Preguntada:

el 8 de Jul. de 2018

Respondida:

el 8 de Jul. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by