loadCenters.m 636 B

1234567891011121314151617181920
  1. function centers=loadCenters(path, patientID, nclass,realizationId)
  2. %path is the core directory
  3. %nclass is number of typical responses sought
  4. %realizationId is the realization number
  5. centers=zeros(1);
  6. for i=1:nclass
  7. code=sprintf('%s_%d_%d_center%d',patientID,nclass,realizationId,i);
  8. ofile=fullfile(path,patientID,sprintf('%s_center.txt',code));
  9. try
  10. fy=readmatrix(ofile,'Delimiter',',');
  11. catch ME
  12. fy=dlmread(ofile,',')
  13. end
  14. if size(centers,1)==1
  15. centers=zeros(nclass,size(fy,2));
  16. end
  17. centers(i,:)=fy;
  18. end
  19. end