how to split num to str ?

1 view (last 30 days)
tomer polsky
tomer polsky on 28 Jun 2018
Edited: madhan ravi on 24 Jan 2019
hello I want to to split a number to str . for exmaple if I write y=-x-2
then I want to get coffient of x
coffient_of_x=-1
k=-2
is it posbile ?

Answers (1)

madhan ravi
madhan ravi on 5 Jul 2018
Edited: madhan ravi on 24 Jan 2019
It’s possible using symbolic math toolbox.
syms x y
y=-x-2
coeffs(y)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!