1D Histogram

data = [3 6 8 7 6 10 8 7 6 3 10 8 6 6 6 8 7 6]; [m,n] = size(data); max = max(data); min = min(data); bin = 1; a = zeros(m, floor(max/bin)); for i = 1:m for j = 1:n val = data(i,j); a(floor(val/bin))= a(floor(val/bin)) + 1; end end bar(a)

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.