Hello, Henrick
According to my understanding you are trying to create a pie chart displaying the top 10 most frequent characters from your dataset, it's important to sort the characters based on their frequencies. In the code provided, the histc function was used to calculate these frequencies. However, it is worth noting that histc is an older function and its use is now discouraged. In the latest version, it is recommended to use the histcounts function, which offers enhanced functionality and is more up-to-date.
Below is a code snippet demonstrating how to achieve this using histcounts:
% Calculate the histogram of letter frequencies (A-Z)
frequencies = histcounts(nummer, 64.5:1:90.5);
In this example, histcounts function is employed to compute the frequency of each letter from 'A' to 'Z'. The function achieves this by specifying the ASCII range from 65 to 90, ensuring accurate frequency calculation.
For further details on the histcounts function, refer to the following MathWorks documentation:
Additionally, for more information on why the use of histc is discouraged, you may consult the relevant documentation, you can refer to this part of the documentation.
Hope this is beneficial!