Skip to content

Instantly share code, notes, and snippets.

@weinberz
Created July 22, 2015 17:57
Show Gist options
  • Save weinberz/18be0079c44bb44bbc60 to your computer and use it in GitHub Desktop.
Save weinberz/18be0079c44bb44bbc60 to your computer and use it in GitHub Desktop.
Simple histograms in MATLAB
names = {}
x = hist(Lifetimes,[50 100 150 200 250 300 350 400])
for i = 1:size(x)
x(:,i) = x(:,i)./sum(x(:,i))
end
hist(Lifetimes,[50 100 150 200 250 300 350 400])
legend(names)
bins = [50 100 150 200 250 300 350 400];
figure()
hold all
for i=1:size(x,2)
bar((bins - i+4),x(:,i),'BarWidth',4)
end
legend(names)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment