
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

% Program name; lec3_uniform_dist.m % Program to generate 20 bins % random numbers from rand function max_bins = 40; N = 150000; rand('state', 0) % initialize y = rand(N,1); % put into 20 bins n = hist(y, max_bins); m_n = max(n); upper_n = m_n + 1000; % plots the data as a bar graph bar(n); axis([0 max_bins+1 0 upper_n]) xlabel('Bin Number, #') ylabel('Number of Data Values in Each Bin')