필터 지우기
필터 지우기

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 CenterFile Exchange에서 Error Detection and Correction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by