function [S] = Cipher2Plain(P)
% function [S] = Cipher2Plain(P)
% P is a 2-by-M matrix of integers between 0 and 25
% S is a string output, containing only capital letters
% S is found after conversion of integers into characters
[n,M] = size(P); % n = 2, M is found dynamically
for i = 1 : 2
for j = 1 : M
switch P(i,j)
case 1,
V(i,j) = 'A';
case 2,
V(i,j) = 'B';
case 3,
V(i,j) = 'C';
case 4,
V(i,j) = 'D';
case 5,
V(i,j) = 'E';
case 6,
V(i,j) = 'F';
case 7,
V(i,j) = 'G';
case 8,
V(i,j) = 'H';
case 9,
V(i,j) = 'I';
case 10,
V(i,j) = 'J';
case 11,
V(i,j) = 'K';
case 12,
V(i,j) = 'L';
case 13,
V(i,j) = 'M';
case 14,
V(i,j) = 'N';
case 15,
V(i,j) = 'O';
case 16,
V(i,j) = 'P';
case 17,
V(i,j) = 'Q';
case 18,
V(i,j) = 'R';
case 19,
V(i,j) = 'S';
case 20,
V(i,j) = 'T';
case 21,
V(i,j) = 'U';
case 22,
V(i,j) = 'V';
case 23,
V(i,j) = 'W';
case 24,
V(i,j) = 'X';
case 25,
V(i,j) = 'Y';
case 0,
V(i,j) = 'Z';
end
end
end
k = 0;
for j = 1 : M
for i = 1 : 2
k = k+1;
S(k) = V(i,j);
end
end