jeudi 27 octobre 2016

Plotting number distribution in Matlab

I create random integers based on the given parameter and would like to plot these randomly generated numbers using hist and subplot. When I use disp(A) I get fine results, but the plotting doesn't work.

  x=-4:.2:4;

for i = 1:n
   A=round(-100+100*rand());
   disp(A)
    c=hist(A,-4:.2:4);
  subplot(n,n,i)
  bar(x,c(:,i))
end




Aucun commentaire:

Enregistrer un commentaire