Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: commBCHEncoder/commBCHDecoder
Replies: 1   Last Post: Mar 6, 2013 9:15 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: commBCHEncoder/commBCHDecoder
Posted: Mar 6, 2013 9:15 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.