Binary string to character conversion
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Brandon
el 20 de Mzo. de 2012
Comentada: Abirami
el 14 de Ag. de 2014
Hello, If I have a string, S = 001000110111 Given:
a = 0
b = 10
c = 110
d = 111
I need to convert the string using that key.
So converted_S = aabaacd
How can I do this? Thanks.
0 comentarios
Respuesta aceptada
Grzegorz Knor
el 20 de Mzo. de 2012
S = '001000110111';
a = '0';
b = '10';
c = '110';
d = '111';
S = strrep(S,d,'d');
S = strrep(S,c,'c');
S = strrep(S,b,'b');
S = strrep(S,a,'a')
5 comentarios
Grzegorz Knor
el 20 de Mzo. de 2012
regexp works correctly in this case :) strrep first looks for patterns, and then replace it.
Más respuestas (0)
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!