dimanche 14 octobre 2018

Get the average result from executing a function multiple times

Let's say I built a function in MATLAB that finds the number of errors in N bits transmitted, and calculates the bit error rate (the ratio between the number of errors and N bits transmitted).

Now, I want to execute this function 100 times to get 100 different results so that I can get an average of the bit error rate for the 100 experiments. How can I do that in MATLAB? A for loop would surely give me 100 results, but how can I get the average from those results?




Aucun commentaire:

Enregistrer un commentaire