Info
This question is closed. Reopen it to edit or answer.
How to make the second case working in the following matlab file ?
1 view (last 30 days)
Show older comments
The first case works well. The case case does not work. Why? I cannot substitute a character with numeric value.
2 Comments
Answers (1)
Azzi Abdelmalek
on 29 Nov 2014
syms t x
syms x0 v0
syms m c k
equ = 'm*D2x + c*Dx + k*x = 0';
ic1 = 'x(0) = x0';
ic2 = 'Dx(0) = v0';
x2 = dsolve(equ,ic1,ic2)
x2=subs(x2,{m,c,k,x0,v0},{2,6,17,2,5})
1 Comment
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!