필터 지우기
필터 지우기

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;
  댓글 수: 2
Martin
Martin 2023년 12월 7일
Thank you!!
Voss
Voss 2023년 12월 7일
You're welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (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