Effacer les filtres
Effacer les filtres

Assigning letters to numbers

1 vue (au cours des 30 derniers jours)
Martin
Martin le 7 Déc 2023
Commenté : Voss le 7 Déc 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.

Réponse acceptée

Voss
Voss le 7 Déc 2023
alphabets = [' ', 'A':'Z'];
Map(alphabets) = 0:numel(alphabets)-1;
  2 commentaires
Martin
Martin le 7 Déc 2023
Thank you!!
Voss
Voss le 7 Déc 2023
You're welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by