How can I define a set of random distributions as I can use this type in the following functions parameter
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Nazer Hdaifeh
am 14 Jun. 2020
Kommentiert: Nazer Hdaifeh
am 15 Jun. 2020
I'm trying to define a set of 'random distribution type' as I can use any of them in the parameter of the a funtion I use.
I tried this for example :
x= struct("poisson", exprnd(Mean, size ), "Gamma", gamma(Mean, size))
now i can write
x.poisson to get the random numbers
but if I want to use another variable i.e:
b=poisson
x.b
the last line makes error and dont give me the value of x.poisson
is there a better idea to map a variable with a set of values?
Thank you!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!