function[output] = encoding(input)
    if input <= 0 | input >= 10 | rem(input, 1) ~= 0 
        error("wrong input")
    else
        switch input
            case 1
                output = 'primary school';
            case {2, 3}
                output = 'high school';
            case {4, 5, 6}
                output = 'bachelor';
            case 7
                output = 'college';
            case 8 
                output = 'doctorate';
            case 9 
                output = 'higher education';
        end
    end
end