readEDKoutputMuNew.m 761 B

123456789101112131415161718192021222324252627
  1. % Surendra Prajapati 2014
  2. % This code extracts the mu/rho (attenuation coefficeint) from the EGS output file --> "... .lst"
  3. % remember the "linenum" may change, so double check that
  4. close all;
  5. clear all;
  6. cd('E:\UW MADISON\Wisc Fall 2014\Kernels-revised_9-24-2014\EDKnrcOutputFiles-After09242014')
  7. energyarr = [5:5:250];
  8. for count = 1:length(energyarr)
  9. fname = strcat(num2str(energyarr(count)),'keV_XCOM_HighRes.egslst');
  10. fid = fopen(fname);
  11. linenum = 185;
  12. data = textscan(fid, '%s', 1, 'delimiter', '\n', 'headerlines', linenum-1);
  13. data2 = data{1};
  14. data3 = cell2mat(data2);
  15. data3 = data3(33:42);
  16. attcoef(count) = str2num(data3);
  17. fclose(fid);
  18. end
  19. attcoef = attcoef';