% loadedDieMean % % Brian D. Jeffs % Oct. 31, 2005 % % This demonstrates computation of the mean die roll using the sample pdf, % i.e. the historgram. echo on load dieRolls plot(x,'+'); a = axis; axis([a(1) a(2) 0 7]); pause average = mean(x) pause P_x = hist(x,[1:6])./length(x); bar(P_x) title('Normalized histogram for loaded die rolls'); xlabel('Number rolled'); ylabel('Sample pmf'); pause mu_x = sum([1 2 3 4 5 6].*P_x) echo off