converting a binary vector to polynomial form?

If i have a binary vector:
x = 1 0 0 1 0 1
how can i convert this to polynomial form:
y = x.^5+x.^2+1
regards.

回答(1 个)

If you have the Symbolic Toolbox, use poly2sym

4 个评论

i dont have it. isnt there an alternate to this.
What output form are you looking for? A function handle? A string written to a file? Or you have a binary polynomial vector P and a matrix of values x and you want y to be the polynomial implied by P evaluated over x?
i have a binary vector representing the 1 and 0 coefficients of a polynomial. i want to convert it to polynomial form, so that its easy for me to see the positions at which i have 1 as the co-efficient.
You could just
find(fliplr(x)) - 1
which would, in this example, output 5 2 0
Anyhow, so you are looking for a string output ?

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Polynomials 的更多信息

提问:

2013-4-24

Community Treasure Hunt

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

Start Hunting!

Translated by