function [data dataS] = computeGraphData(dataMatrix, nBin)

data.sizeVector = 0.5*dataMatrix(2:end, 2) + 0.5*dataMatrix(1:(end-1), 2);
data.volFractionVector = dataMatrix(1:(end-1), 4) / 100;
data.countVector = dataMatrix(1:(end-1), 3);


% nBin = 5;
leftRange = 1:nBin:size(dataMatrix, 1);
rightRange = (nBin+1):nBin:size(dataMatrix, 1);
if length(rightRange) < length(leftRange)
    leftRange(end) = [];
end
dataS.sizeVector = 0.5*dataMatrix(leftRange) + 0.5*dataMatrix(rightRange);
dataS.volFractionVector = dataS.sizeVector*0;
dataS.countVector = dataS.sizeVector*0;
for i = 0:(nBin-1)
    dataS.volFractionVector = dataS.volFractionVector + ...
        dataMatrix(leftRange + i, 4)' / 100;
    dataS.countVector = dataS.countVector + ...
        dataMatrix(leftRange + i, 3)';
end


% minCount = 100;
% dataS = data;
% iLeft = 1;
% iRight = 0;
% % thisMin = 100;
% % thisMax = dataMatrix(2, 2);
% while iPos < length(dataS.sizeVector)
%     iRight = iRight + 1;
%     thisRange = iLeft:iRight;
%     if sum(dataS.countVector(thisRange)) > 100
%         dataS.
%     else
%     end
% end