Info

This question is closed. Reopen it to edit or answer.

Hi all, i'm new to matlab and really need help. I've a binary message and three row vectors, red, green and blue. I want to replace 2 bits of each row vector by the binary message till the message ends. I'm unable to move through the message.

1 view (last 30 days)
Here is the part of my code.
msg='Hello';
Ascii = reshape(dec2bin(msg, 8)', 1, []) - '0';
for i=1:length(Ascii)
for x=(i):(i+1)
redLsbVector(x)=Ascii(x);
end
for x=(i):(i+1)
greenLsbVector(x)=Ascii(x+2);
end
for x=(i):(i+1)
blueLsbVector(x)=Ascii(x+4);
end
end
Also please help when to come out of the loop. Thanks in advance!

Answers (0)

Community Treasure Hunt

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

Start Hunting!