% m-file: demo_5.m
%
% (C) PK, 08/11/2018;

clc; clear; close all;

N=2^12; M=4;
X=rand(N,M);
Y=zeros(N,1);
for m=1:M,
   Y=Y+X(:,m); 
end;
 % Y=sum(X.').';
K=10;
[hy,by]=hist(Y,K);  
    figure(1);
        for m=1:M,
            [h,b]=hist(X(:,m),K);
            subplot(M+1,1,m); bar(b,h,1); grid on;
        end;    
            subplot(M+1,1,M+1); bar(by,hy,1); grid on;
% EOF;