Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: commBCHEncoder/commBCHDecoder
Posted:
Mar 6, 2013 9:15 AM
|
|
"Timothy Koh" <timothy_koh87@hotmail.com> wrote in message news:kh7iap$di3$1@newscl01ah.mathworks.com... > hi > > i am facing some problem encoding a 480x640 image with commBCHEncoder. > i manage to convert the image into matrix using imread where i will get > <480x640x3 unit8>. > Next i use B=(A(:,:,1)); where A is my image is matrix. > C=reshape(B,[],1); > D=dec2bin(C);
http://www.mathworks.com/help/matlab/ref/dec2bin.html
"str = dec2bin(d) binary representation of d as a string."
If you want D to contain the numbers 0 and 1 instead of the characters '0' and '1' then use either:
D = D - '0'; % or D = (D == '1');
Since the error message indicates that either numeric or logical variables are acceptable, either of these should work.
*snip*
-- Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com
|
|
|
|