converting a binary vector to polynomial form?
4 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Walter Roberson
2013-4-24
4 个评论
Walter Roberson
2013-4-26
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 ?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polynomials 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!