• 大小: 2.99MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-19
  • 语言: Matlab
  • 标签: MATLAB  EEG  

资源简介

matlab中将txt格式的大脑数据导入,然后进行分类处理。

资源截图

代码片段和文件信息

function [bvdeoxyFstmarker_timemarker_index]=loadnirUSB();
         %[bvdeoxyFstmarker_indexfilenamefilepathFMSNR]=loadnir();

%LOADNIR -- Loads fNIRS Brain Data and converts it into DeOxy and BV
%
%Concentration Solutions are performed by a Standard or Chance Algorithm

%%%%%%%%%% LOAD FILE%%%%%%%%%%%%%%%%

[filenamefilepath]=uigetfile(‘*.txt‘‘Pick Your Data‘);
disp([‘Okunan dosya: ‘ filepath filename])
raw_data = dlmread(sprintf(‘%s%s‘filepathfilename)‘ ‘);

cxx=zeros(size(raw_data));
cxx(:1:48)=raw_data(:2:49);
cxx(:49)=raw_data(:1);

raw_data=cxx;
%time=raw_data(:1);
%det=raw_data(:49);
%raw_data(:49)=time;
%raw_data(:1)=det;



%%%%%%%%FINDING SOLUTION INSTANCES%%%%%%%%%%%%%%%%%%
% Emir Alkas‘larin dosya protokolu i鏸n ekleme
% -1 ve -2 --> -6000
[ij] = find(raw_data == -1);
raw_data(i j) = -6000;

[ij] = find(raw_data == -2);
raw_data(i j) = -6000;




[ij]=find(raw_data(:2)==-6000);
context=raw_data(i49);  % Location of context (0000)
[MN]=size(raw_data);
Mn=M-length(i);

raw_datat=zeros(MnN);
marker_index=i;
marker_time=raw_data(marker_index49);
marker_data = zeros(1Mn);
marker_index=marker_index-[1:length(marker_index)]‘;%%marker index correction

raw_datat=zeros(MnN);

if ~isempty(i)
    %%%%%%%%%%%REMOVING 00000 SPIKES%%%%%%%%%%%%%
    sa=setdiff([1:M]i);
    raw_datat=raw_data(sa:);
    raw_data=raw_datat;
else
    i=1;
end


[ij]=find(raw_data(:1)==-6000);
targets=raw_data(i49); % Location of target (XXXXXX)
[MN]=size(raw_data);
Mn=M-length(i);



if ~isempty(i)
    %%%%%%%%%%%REMOVING XXXXX SPIKES%%%%%%%%%%%%%
   sa=setdiff([1:M]i);
 
raw_datat=raw_data(sa:);
  raw_data=raw_datat;
else
  i=1;
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%Wavelet Denoising%%%%%%%%%%%%%
[MN]=size(raw_data);

oeraw=raw_data(:1:N-1);
t = raw_data(:N);

% OE=questdlg(‘Outlier Elimination‘‘Outlier elimination ?‘ ‘Yes‘‘No‘ ‘Cancel‘‘No‘);
% switch OE
% case ‘Yes‘   
%     disp(‘Outlier Elimination...‘)
%     
%     [mmk]=find(max(abs(diff(raw_data)))>200);
%     
%     for k=1:length(mk)
% %        if max(abs(detrend(raw_data(:k)1))/norm(detrend(raw_data(:k)1)))>0.09
%             mk(k)
%             oeraw(:mk(k))=outlier(raw_data(:mk(k))‘50.3)‘;
% %        end
%     end
%     raw_data(:1:N-1)=oeraw; 
% case ‘No‘
%     raw_data=raw_data;
% case ‘Cancel‘
%     return;
% end


% den=questdlg(‘Perform Wavelet Denoising‘ ‘Perform Wavelet Denoising ?‘‘Yes‘‘No‘ ‘Cancel‘ ‘No‘);
% switch den
% case ‘Yes‘
%     Fs=1/mean(diff(raw_data(:49)))
%     %up= round(15/Fs);
%     %down=round(Fs*up/5);
%     %NewFs=Fs*up/down;
%     
%    % for n=1:49
%     %    new_data1(:n)=interp(raw_data(1:Mn)up);
%      %   [MMNN]=size(new_data1);
%       %  new_data2(:n)=decimate(new_data1(1:MMn)down);
%       %end
%     
%     [MN]=size(raw_data)
%     XDraw=zeros(MN-

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     685647  2006-08-07 16:28  PART3_IAPS_SES1_EEG_fNIRS_07082006.txt

     文件     545277  2006-08-08 15:12  PART3_IAPS_SES2_EEG_fNIRS_08082006.txt

     文件     544202  2006-08-08 15:31  PART3_IAPS_SES3_EEG_fNIRS_08082006.txt

     文件     741426  2006-08-07 17:16  PART4_IAPS_SES1_EEG_fNIRS_07082006.txt

     文件     709584  2006-08-08 16:59  PART4_IAPS_SES2_EEG_fNIRS_08082006.txt

     文件     690440  2006-08-09 12:22  PART4_IAPS_SES3_EEG_fNIRS_09082006.txt

     文件     647184  2006-08-08 11:27  PART5_IAPS_SES1_EEG_fNIRS_08082006.txt

     文件     628730  2006-08-09 13:48  PART5_IAPS_SES2_EEG_fNIRS_09082006.txt

     文件     504467  2006-08-09 14:07  PART5_IAPS_SES3_EEG_fNIRS_09082006.txt

     文件       9472  2006-10-27 11:46  loadnirS.m

     文件     815913  2006-08-03 19:34  PART1_IAPS_SES1_EEG_fNIRS_03082006.txt

     文件     617588  2006-08-07 12:24  PART1_IAPS_SES1_EEG_fNIRS_06082006.txt

     文件     617776  2006-08-08 12:37  PART1_IAPS_SES3_EEG_fNIRS_08082006.txt

     文件     544412  2006-08-07 15:25  PART2_IAPS_SES1_EEG_fNIRS_07082006.txt

     文件     499755  2006-08-08 16:14  PART2_IAPS_SES2_EEG_fNIRS_08082006.txt

     文件     571364  2006-08-09 11:35  PART2_IAPS_SES3_EEG_fNIRS_09082006.txt

----------- ---------  ---------- -----  ----

              9373237                    16


评论

共有 条评论