converting a binary vector to polynomial form?
Mostrar comentarios más antiguos
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
el 24 de Abr. de 2013
0 votos
4 comentarios
Malik
el 24 de Abr. de 2013
Walter Roberson
el 24 de Abr. de 2013
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?
Malik
el 25 de Abr. de 2013
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 ?
Categorías
Más información sobre Polynomials en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!