function out = check_log_rec_v2(monkey,date,datadir,block_number,instances,hubs,stimbit,log_prefix) disp(['%%%%% Block: ',num2str(block_number)]); for instance_idx = instances for hub_idx = hubs instance_name = ['\Hub',num2str(hub_idx),'-instance',num2str(instance_idx),'_B',sprintf('%03.0f', block_number)]; instance_NEV_filename = [datadir,monkey,'\',date,'\Block_',num2str(block_number),'\',instance_name,'.nev']; EVENT = openNEV(instance_NEV_filename,'nosave'); Trials_idxs=find(EVENT.Data.SerialDigitalIO.UnparsedData==2^stimbit);%starts at 2^0, till 2^7 load([datadir,monkey,'\_logs\',log_prefix,monkey,'_',date,'_B',num2str(block_number)],'MAT') is_ok = (length(Trials_idxs)==length(MAT)); if is_ok disp(['Instance: ',num2str(instance_idx),' Block: ',num2str(hub_idx),' is OK!']); else disp(['Instance: ',num2str(instance_idx),' Block: ',num2str(hub_idx),' is NOT ok!!!']); end out(instance_idx) = is_ok; clear instance_name instance_NEV_filename EVENT Trials_idxs MAT is_ok end end fprintf('\n');