TP-probabilites/TP2/calcul_frequences.m
2023-06-10 21:01:20 +02:00

15 lines
244 B
Matlab

## Author: Laurent
## Created: 2020-11-10
function freq = calcul_frequences (texte, alphabet)
freq = [];
for lettre = alphabet.'
freq = [freq; length(find(texte==lettre))/length(texte)];
endfor
freq = freq.';
endfunction