I am trying to plot the number of times that values repeat between excel files. This code will be dealing with 200+ excel files per run that are formatted the same way.
For example, between file names "output3" and "output4", I want to see how many times a value repeats in excel columns 2 through 4. If there would be 5 values that overlap between these two excel files then on the plot, there would be a bar with a value of 5 and a label saying "between output3 and output4". I have attached my code attempt below with comments as to what I am trying to do in each section:
L = length(fieldnames(data));
firstoutput = data.(sprintf("variables_%d", i));
secondoutput = data.(sprintf("variables_%d",j));
data.idx2{i} = ismember(firstoutput(:,2),secondoutput(:,2));
data.idx3{i} = ismember(firstoutput(:,3),secondoutput(:,3));
data.idx4{i} = ismember(firstoutput(:,4),secondoutput(:,4));
isTrue2 = cellfun(@(x)isequal(x,1),data.idx2);
isTrue3 = cellfun(@(x)isequal(x,1),data.idx3);
isTrue4 = cellfun(@(x)isequal(x,1),data.idx4);
x = sprintf("output%d",n);
bar(length(idx2_true),names)
bar(length(idx3_true),names)
bar(length(idx4_true),names)