Create a matrix where each element is a Binomial distribution

10 ビュー (過去 30 日間)
Orongo 2017 年 10 月 11 日
コメント済み: dpb 2017 年 10 月 11 日
Hi, I want to create a matrix Y where each element is its own unique Binomial distribution. I want the parameters N and P be the matrices
and so on. I use Binornd(N,P) which result in a 4x4 matrix filled with NaN. What is going wrong? and how can I create the matrix Y?
  1 件のコメント
dpb 2017 年 10 月 11 日
You're getting NaN because the first parameter of the binomial has to be positive integer for number of trials and you're passing a floating point value that is sampled from gaussian so is -inf,inf theoretical, -3,+3 in practical terms for 99+% of cases.
You also can't put multiple outputs into a single location of an array; you could use a cell array to hold the outputs, but not a double.


回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by