MATLAB Answers

I Made

From logical to binary ?

Asked by I Made
on 14 Mar 2013

So firstly i have convert a string into decimal then i do a xor to it so as the result i have a logical result stored in the variable k.

    word = 'TEST';
    binary = dec2bin(word,8);
    k = xor(bin, t4(1:length(bin)));

i tried to convert back using bin2dec function like :

    w = xor(k, t4(1:length(bin)));

But got an error say that the Input must be a string. i think it is because the input are logical value. Can someone correct me? or show me how to convert back from logical to binary ?


Log in to comment.


No products are associated with this question.

1 Answer

Answer by ChristianW
on 14 Mar 2013
 Accepted Answer




Log in to comment.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!