フィルターのクリア

converting to binary type,binary type generation

1 回表示 (過去 30 日間)
aya
aya 2013 年 12 月 11 日
コメント済み: aya 2013 年 12 月 11 日
I am using this program to find the reminder of two polynomials under Galois field it works well
m=[0 1 1 0 0 1 1];
vector=[0 0 0 0 0 0 0 0 1];
mvec=gfconv(m,vector);
g=[1 0 0 0 1 0 1 1 1];
[qq,rr]=gfdeconv(mvec,g);
code=gfadd(mvec,rr);
but when i am trying to get the m randomly
m=rand(1,7)>0.5;
i am getting this error message
??? Error using ==> gfconv
The input elements must be binary.
at the work space m look like this with logical type <1x7 logical>

採用された回答

Walter Roberson
Walter Roberson 2013 年 12 月 11 日
m=rand(1,7)>0.5+0;
  4 件のコメント
Andrei Bobrov
Andrei Bobrov 2013 年 12 月 11 日
m = round(rand(1,7));
m = randi([0 1],1,7);
aya
aya 2013 年 12 月 11 日
thanks allot Andrea Bobrov it finally works

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeError Detection and Correction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by