Borrar filtros
Borrar filtros

converting a binary vector to polynomial form?

4 visualizaciones (últimos 30 días)
Malik
Malik el 24 de Abr. de 2013
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.

Respuestas (1)

Walter Roberson
Walter Roberson el 24 de Abr. de 2013
If you have the Symbolic Toolbox, use poly2sym
  4 comentarios
Malik
Malik el 25 de Abr. de 2013
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.
Walter Roberson
Walter Roberson el 26 de Abr. de 2013
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 ?

Iniciar sesión para comentar.

Categorías

Más información sobre Polynomials en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by