string=input('enter a phrase: ', 's');
count=0;
clear ch;
for let=string
    no_match=true;
    for i=1:count
        if ch(i).val==let
            ch(i).num=ch(i).num+1;
            no_match=false;
            break;
        end
    end
    if no_match
        count=count+1;
        ch(count).val=let;
        ch(count).num=1;
    end
end
disp('ch | count');
disp('----------');
for i=1:count
    nextline=[' ' ch(i).val ' | ' num2str(ch(i).num)];
    disp(nextline);
end
        
    