Borrar filtros
Borrar filtros

Assigning letters to numbers

1 visualización (últimos 30 días)
Martin
Martin el 7 de Dic. de 2023
Comentada: Voss el 7 de Dic. de 2023
Hi, I have a simple question. I'm trying to do a Hill Cipher decryption as a project, and I wanted to add "space" as 0, and start A as 1, all the way through Z as 26, so that the cipher will be done with mod27 instead. I could get my alphabets
alphabets = 'A':'Z';
Map(alphabets) = 1:length(alphabets);
But I would like to start from "space" as 0.

Respuesta aceptada

Voss
Voss el 7 de Dic. de 2023
alphabets = [' ', 'A':'Z'];
Map(alphabets) = 0:numel(alphabets)-1;
  2 comentarios
Martin
Martin el 7 de Dic. de 2023
Thank you!!
Voss
Voss el 7 de Dic. de 2023
You're welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by