how to represent binary values as polynomial expression?

hello ,
i m working with cyclic codes,where i have to generate polynomial expression for the binary sequences for example
a=[1 0 1 1]
i tried with poly2sym(a)..it worked..
my problem is when a=1011 i m getting output as 1..
similary i have to generate polynomial xepression for 16 possible bits.
plz,suggest me...

 採用された回答

Grzegorz Knor
Grzegorz Knor 2011 年 11 月 3 日

0 投票

My suggestion:
a=1011
tmp = sprintf('%i',a);
a = str2num(sprintf('%c ',tmp(:)));
poly2sym(a)

3 件のコメント

Walter Roberson
Walter Roberson 2011 年 11 月 3 日
a=1101;
poly2sym(sprintf('%d',a) - '0')
Grzegorz Knor
Grzegorz Knor 2011 年 11 月 3 日
smartly :)
faa nad
faa nad 2011 年 11 月 5 日
thanks for the reply

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Polynomials についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by