How do I limit the repmat?
Mostrar comentarios más antiguos
I am trying to create a function to code or decode a message and was suggested that i use repmat and mod. I understand how the mod works but the repmat is confussing me. lets say my message is:
MATLAB
and the key is:
[2,4,6,3]
How would i get the key to become:
[2,4,6,3,2,4]
to change each of the letters in matlab? I realize that I need to use double to convert the text to numbers and char to convert the changed numbers back to text.
Any help would be Appreciated.
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 21 de Mzo. de 2013
Editada: Azzi Abdelmalek
el 21 de Mzo. de 2013
x=[2,4,6,3]
y=repmat(x,1,2) % Duplicate horizontally twice
y=y(1:6)
Categorías
Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!