readEDKoutputPriFracNew.m 792 B

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