- Save the probability distribution object from the "distributionFitter" app to the workspace. It usually saves a variable named "pd".
- Use the "truncate" function to create a new distribution object within the desired limits.
- Use the "random" function to generate numbers randomly using the distribution object.
How to randomly sample points within some range using a distribution fit obtained from distribution fitter app?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 20 Ott 2020
Modificato: MathWorks Support Team
il 31 Gen 2025
I am used distribution fitter app to fit a probability distribution on my data, and I am able to save distribution object to workspace.
Now I want to use newly fitted distribution to generate random numbers within a desired range.
Please help me in achieving this workflow.
Risposta accettata
MathWorks Support Team
il 25 Gen 2025
Modificato: MathWorks Support Team
il 31 Gen 2025
As a workaround, please try the following steps:
>> pd_truncated = truncate(pd,45,60); >> number = random(pd_truncated)
For more details, you can refer to the documentation about the "truncate" function by executing the commands in the MATLAB R2020a command window:
>> web(fullfile(docroot, 'stats/prob.normaldistribution.truncate.html'))
For more details, you can refer to the documentation about the "random" function by executing the commands in the MATLAB R2020a command window:
>> web(fullfile(docroot, 'stats/prob.normaldistribution.random.html'))
Please follow the link below to search for the required information regarding the current release:
0 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!