MATLAB: Letter refer to number

charconvertintegerletterMATLABnumber

I did use A B C D E F … for 1 2 3 4 5 6 …. with the following code:
Nr=[1 2 3 4 5 6];
Letter=char(Nr+'A'-1);
Letter =
ABCDEF
But now i want to get back the originals number instead of the corresponding letters (Nr is not avaible anymore).

Best Answer

Nr2 = double(Letter)-'A'+1