function [predictionZoneSize, testInstanceType, type1SizeInPredictionZone, type2SizeInPredictionZone, type5SizeInPredictionZone] = findMyClassStatistics(myRow, predictionZone, center1, center2, center5) predictionZoneSize = size(predictionZone,1); testInstanceType = 0; type1SizeInPredictionZone = 0; type2SizeInPredictionZone = 0; type5SizeInPredictionZone = 0; rowClassFound = 0; %for each element in the prediction zone for i = 1:predictionZoneSize controlInstance = predictionZone(i,:); for j = 1:size(center1,1) % first decide on the test instance's center type if ~rowClassFound if sum(center1(j,:) - myRow) == 0 testInstanceType = 1; rowClassFound = 1; end end % now decide on the control instance's center type if sum(center1(j,:) - controlInstance) == 0 type1SizeInPredictionZone = type1SizeInPredictionZone + 1; continue; end end for k = size(center2,1) % first decide on the test instance's center type if ~rowClassFound if sum(center2(k,:) - myRow) == 0 testInstanceType = 2; rowClassFound = 1; end end % now decide on the control instance's center type if sum(center2(k,:) - controlInstance) == 0 type2SizeInPredictionZone = type2SizeInPredictionZone + 1; continue; end end for l = size(center5,1) % first decide on the test instance's center type if ~rowClassFound if sum(center5(l,:) - myRow) == 0 testInstanceType = 5; rowClassFound = 1; end end % now decide on the control instance's center type if sum(center5(j,:) - controlInstance) == 0 type5SizeInPredictionZone = type5SizeInPredictionZone + 1; continue; end end end end