Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Hi All, pls i need a command line to plot a histogram,cdf and pdf of the pasted matlab program. (binomial n=5, p=0.4)

1 回表示 (過去 30 日間)
oshomah kanoba
oshomah kanoba 2015 年 3 月 9 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
clc clear all format compact rng(970,'v4') X =[]; U =[]; for i = (1:10000) r =rand; if r <=0.07776 x=0; X=[X x]; U=[U r]; else if r>0.07776 & r<=0.33696 x=1; X=[X x]; U=[U r]; else if r>0.33696 & r<=0.68256 x=2; X=[X x]; U=[U r]; else if r>0.68256 & r<=0.91296 x=3; X=[X x]; U=[U r]; else if r>0.91296 & r<=0.98976 x=4; X=[X x]; U=[U r]; else if r>0.98976 & r<=1 x=5; X=[X x]; U=[U r]; end end end end end end end
  1 件のコメント
Adam
Adam 2015 年 3 月 9 日
Please use the '{} Code' block to format code in a readable fashion.

回答 (0 件)

この質問は閉じられています。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by