function y=b26b10(x)
%Input a character string with no spaces, numbers or symbols
%output an integer in base 10.

if ischar(x)~=1
    error('Not character data')
end

y=0;
n = length(x);
z=zeros(n,1);
x=lower(x);
for i=1:n
    switch x(i)
        case 'a'
           z(i)=0;
        case 'b'
             z(i)=1;
        case 'c'
            z(i)=2;
        case'd'
             z(i)=3;
        case'e'
            z(i)=4;
        case'f'
            z(i)=5;
        case'g'
            z(i)=6;
        case'h'
            z(i)=7;
        case'i'
            z(i)=8;
        case'j'
            z(i)=9;
        case'k'
             z(i)=10;
            case'l'
                z(i)=11;
            case'm'
                z(i)=12;
            case'n'
                z(i)=13;
            case'o'
                z(i)=14;
            case'p'
                z(i)=15;
            case'q'
                z(i)=16;
            case'r'
                z(i)=17;
            case's'
                z(i)=18;
            case't'
                z(i)=19;
            case'u'
                z(i)=20;
            case'v'
                z(i)=21;
            case'w'
                z(i)=22;
            case'x'
                z(i)=23;
            case'y'
                z(i)=24;
            case'z'
                z(i)=25;
            otherwise
                error('Non-alphabetic character');
        end
    end
    for i=1:n
        y=z(i)*26^(n-i)+y;
    end
end
