Created
July 22, 2015 17:57
-
-
Save weinberz/18be0079c44bb44bbc60 to your computer and use it in GitHub Desktop.
Simple histograms in MATLAB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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