fixing_char_outputfile.m 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. %Repairing p05 -> Outfile was corrupted and all values was codes as
  2. %characters. This was especially problematic for rotations.
  3. clear all
  4. mainfolder='/LindeDomingoJuan/Memoreye_DATA/'
  5. partis_sub= [{'p33_trimmed'}]
  6. partis_sub2= [{'p33'}]
  7. % 05 I need to recue this participant data (outputfile as Character,
  8. % problems with rotations
  9. %%
  10. fulldataset =[];
  11. for ppp=1:length(partis_sub)
  12. % Loading dataset
  13. subtable=[];
  14. sub = tdfread([mainfolder '/logfiles/resultfile_' partis_sub{ppp,:} '.txt'],'tab'); %Logfile for this participant
  15. subtable=struct2table(sub);
  16. load([mainfolder '/sequences/m_sequence_' partis_sub2{ppp,:} '.mat']); %Logfile for this participant
  17. %Removing first presentation of block 3 and second header
  18. % subtable_b=subtable([1:96 138:617],:);
  19. % %Info that need to be change from str 2 num
  20. name_header=subtable.Properties.VariableNames'
  21. % to_change=[0;0;0;0;1;1;1;0;1;1;0;0;1;1;1;1;1;1;1;0;1;1;1;1;1;0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1];
  22. to_change=[0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;0;1;0;0;0;1;1;1;1;1;1;1;1;1;1;1;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0]
  23. subtable_c=[];
  24. for nnn=1:size(name_header,1)
  25. if to_change(nnn)==1
  26. toeval= ['subtable_c.' name_header{nnn} '=str2num(subtable.' name_header{nnn} '(1:512,:))'];
  27. eval(toeval)
  28. else
  29. toeval= ['subtable_c.' name_header{nnn} '=(subtable.' name_header{nnn} '(1:512,:))'];
  30. eval(toeval)
  31. end
  32. end
  33. fixedtable=struct2table(subtable_c);
  34. subtable=fixedtable;
  35. end