string of binary to letters??

2 views (last 30 days)
amira hl
amira hl on 9 Jun 2015
Commented: amira hl on 9 Jun 2015
Hi
This is my code:
bin
for i=1:size(bin,1)
for j=1:size(bin,2)
mot=num2str(bin(i,j));
bina(i,j)=mot;
end
end
bina
____________________________________________________________________________________________________________________
bin =
1 1 1 0 1 0 0
1 1 0 1 0 0 0
bina =
1110100
1101000
I want to convert this 'bina' or the 'bin' into the initial letters, which are "th". How can i do that?
Thank you

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 9 Jun 2015
Edited: Azzi Abdelmalek on 9 Jun 2015
bin=[0 0 1 0 1 0;1 0 0 1 0 1]
a=cellstr(num2str(bin)),
bina=strrep(a,' ','')

More Answers (1)

James Tursa
James Tursa on 9 Jun 2015
char(bin2dec(char(bin+'0')))'

Categories

Find more on Colormaps in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!