12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- %%% export MUA - THINGS dataset
- % 2022 P. Papale fecit
- clear all
- addpath(genpath('\_code\code_utils_v2\'));
- % constants
- monkey = 'monkeyF';
- datadir_gen = '\';
- reliab_th = .3;
- arrays_to_export = 1:16;
- % arrays_to_export(5) = [];
- %
- filename = [datadir_gen,monkey,'\THINGS_normMUA.mat'];
- load(filename)
- % divide all into arrays
- idx_array = 0;
- for i = 1:1024
- idx_chn = mod(i,64);
- if idx_chn == 1
- idx_array = idx_array+1;
- elseif idx_chn == 0
- idx_chn = 64;
- end
- idx_mapping(i,:) = [idx_array,idx_chn];
- train_MUA_array(idx_array,idx_chn,:) = train_MUA(i,:);
- test_MUA_array(idx_array,idx_chn,:) = test_MUA(i,:);
- mean_reliab_array(idx_array,idx_chn) = mean(reliab(i,:));
- end
- % threshold based on reliability and export
- for i = arrays_to_export
- clear temp_rel good_chns train_MUA test_MUA filename
- temp_rel = mean_reliab_array(i,:) > reliab_th;
- good_chns = find(temp_rel);
- train_MUA = train_MUA_array(i,temp_rel,:);
- test_MUA = test_MUA_array(i,temp_rel,:);
- filename = [datadir_gen,monkey,'\THINGS_exportMUA_array',num2str(i),'.mat'];
- save(filename,'test_MUA','train_MUA','temp_rel','good_chns','-v7.3')
- pause(5)
- end
|