When U is in [0,1] and X is any single value in that range, then the probability that is
When U is in [0,1] and X is a range of values in that range, you should not really be asking for : you should be asking for and in the uniform random case, that would be max(X)-min(X)
In order to simulate, you are going to need to break down the probability range into a number of "bins", such as every 0.01 probability. Let the number of bins be called N. Create a vector of counts, C, which is B long.
Now generate a random number, U. Multiply it by B, and take the ceiling. If you are using any of the MATLAB supplied random number generators, the result will be at least 1. Now add 1 to every entry in C that is indexed from 1 to that number.
Repeat this random number generation a number of times.
Now for any given entry in C, at index K, then C(K) is the probability that U was at least (K-1)/B
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Translated by
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.