MATLAB: Binomial Simulator in Matlab with M= number of experiments

binomial simulation matlab cdfMATLAB

Hello, I must make a simulator that uses binomial distribution, where
  • n= number of tries in each experiment (is either 0(false) or 1(true)
  • p= success probability
  • m= number of experiments
If for example, let's say n=10, and m= 5, it means the simulator must run 10 tries of F/T events with the given probability (lets say its 0.3) 5 times, which means 50 individual events, and I must graph the results in a histogram with X= number of successes in every N and y= pdf
The thing is, I'm getting confused as how to handle the mix of n and m! Please help

Best Answer

Instead of
k(j)=B(1);
you need
k(j)=sum(B);