function [TopicComp,SpatialTopic] = ProbMatMake(splitLDAinput,PredictedTopics, maxT)
row = [];
col = [];
j=1;
for i = 1:length(splitLDAinput)
    if splitLDAinput(i,2)==0
        [row(j),col(j)] = maplin2square(i,28,28);
        j=j+1;
    end
end

SpatialTopic = PredictedTopics;
for i = 1:length(row)
    SpatialTopic(row(i),col(i))=0;
end
probMat = zeros(1,maxT);
for i = 1:maxT
    probMat(i)= sum((SpatialTopic==i),'All');
end

TopicComp = probMat./(sum(probMat,'All'));
end