Assigning letters to numbers

1 次查看(过去 30 天)
Martin
Martin 2023-12-7
评论: Voss 2023-12-7
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.

采纳的回答

Voss
Voss 2023-12-7
alphabets = [' ', 'A':'Z'];
Map(alphabets) = 0:numel(alphabets)-1;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by