Filter löschen
Filter löschen

Assigning letters to numbers

1 Ansicht (letzte 30 Tage)
Martin
Martin am 7 Dez. 2023
Kommentiert: Voss am 7 Dez. 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.

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by