Clear Filters
Clear Filters

i=dsolve('​Dy=-8*y+40​*sin(8*t)'​,'y(0)=5') Warning: Support for character vector or string inputs will be removed in a future release. Instead, use syms to declare variables and replace inputs such as dsolve('Dy = -3*y') with syms y(t); dsolve(diff(y,

1 view (last 30 days)
i=dsolve('Dy=-8*y+40*sin(8*t)','y(0)=5')
Warning: Support for character vector or string inputs will be
removed in a future release. Instead, use syms to declare
variables and replace inputs such as dsolve('Dy = -3*y') with syms
y(t); dsolve(diff(y,t) == -3*y). > In dsolve (line 126)
  2 Comments
Noah Prisament
Noah Prisament on 27 Nov 2023
Hi Juan, this question would be better posted in MATLAB Answers. But to resolve this warning, you can use the dsolve syntax described in the warning and explained in this documentation: https://www.mathworks.com/help/symbolic/dsolve.html which uses symbolic equations instead of an equation string.
Walter Roberson
Walter Roberson on 11 Dec 2023
syms y(t)
i = dsolve(diff(y) == -8*y + 40*sin(8*t), y(0) == 5)
This leads to the result
i =
(15*exp(-8*t))/2 - (5*2^(1/2)*cos(8*t + pi/4))/2

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!