The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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: 18,038
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" <> wrote in message
> 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);

"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.


Steve Lord
To contact Technical Support use the Contact Us link on

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.