function centers=loadCenters(path, patientID, nclass,realizationId) %path is the core directory %nclass is number of typical responses sought %realizationId is the realization number centers=zeros(1); for i=1:nclass code=sprintf('%s_%d_%d_center%d',patientID,nclass,realizationId,i); ofile=fullfile(path,patientID,sprintf('%s_center.txt',code)); try fy=readmatrix(ofile,'Delimiter',','); catch ME fy=dlmread(ofile,',') end if size(centers,1)==1 centers=zeros(nclass,size(fy,2)); end centers(i,:)=fy; end end