Borrar filtros
Borrar filtros

converting to binary type,binary type generation

1 visualización (últimos 30 días)
aya
aya el 11 de Dic. de 2013
Comentada: aya el 11 de Dic. de 2013
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>

Respuesta aceptada

Walter Roberson
Walter Roberson el 11 de Dic. de 2013
m=rand(1,7)>0.5+0;
  4 comentarios
Andrei Bobrov
Andrei Bobrov el 11 de Dic. de 2013
m = round(rand(1,7));
m = randi([0 1],1,7);
aya
aya el 11 de Dic. de 2013
thanks allot Andrea Bobrov it finally works

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Error Detection and Correction en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by