How to generate samples from a known probability density function (PDF) in MATLAB? What is the best/ simplest method? Do different sampling methods vary significantly in computational time?
Hi Ahmad, I am not sure if it is that your are searching but Matlab have an interactive tool for random number generation using a probability distrbution, wich results are able to be exported. The tool is called "randtool" and it is included in the Statistic and Learning Machine toolbox. The link give an explain of how it work:
Thank you very much for your valuable suggestion. Can you please tell me how can I use "randtool" in my M-file? I am going to input its parameters in my M-file and put the generated samples in a matrix.
Dear Doctor Ahmad, I am glad to consider my answer helpful. As the name says randtool is a tool in the form of an interface for genetation of random numbers, unfortunately until I have tried I could not find a code that implements it directly in a .m file. However, an alternative that I used for this inconvenience is to generate the set or random sets, export them to the workspace with preset names and then run the m file. Again I hope this information will help. Regards.