⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loadeep.m

📁 含有多种ICA算法的eeglab工具箱
💻 M
字号:
% loadeep() - Load a continous ANT EEP file (*.cnt).%% Usage:%   >> [eep] = loadeep(file, varargin);%% Inputs:%            filename    - name of ANT EEP file, including extension (*.cnt)%%   Optional inputs:%           'time1'      - start time in seconds.%           'sample1'    - start at sample1, default 0.%                          (Overrules time1) %           'time2'      - end time of data to be  read in seconds, default = whole file.%           'sample2'    - end sample of data to be read, default = whole file.%                          (Overrules time2)% Outputs:%   [eep]                - data structure holding continous EEG information and other%                          relevant information.%% Author: Maarten-Jan Hoeve, ANT Software, The Netherlands / www.ant-software.nl, 8 October 2003%% See also: eeglab(), pop_loadeep()%123456789012345678901234567890123456789012345678901234567890123456789012% Copyright (C) 2003 Maarten-Jan Hoeve, ANT Software, The Netherlands, m.hoeve@ieee.org / info@ant-software.nl%function r=loadeep(file, varargin)if nargin < 1	help loadeep;	return;end;	% defaultsif ~any(file=='.'), file=[file '.cnt']; end[datdir,name,ext]=fileparts(file);disp(['Loading file ' file ' ...'])% read short piece of data to get sampling rate, channels etceeg = read_eep_cnt(file,1,2);if ~isempty(varargin)	 r=struct(varargin{:});else r = []; end;% add defaultstry, r.time1;       catch, r.time1=0; endtry, r.sample1;     catch, r.sample1=[]; endtry, r.time2;       catch, r.time2=[]; endtry, r.sample2;     catch, r.sample2=[]; endr.filename=file;r.totsamples=eeg.nsample;r.nchannels=eeg.nchan;r.rate=eeg.rate;% Create struct for holding channel labelsfor i=1:r.nchannels    chanlocs(i).labels=char(eeg.label(i));    chanlocs(i).theta=0;    chanlocs(i).radius=0;    chanlocs(i).X=0;    chanlocs(i).Y=0;    chanlocs(i).Z=0;    chanlocs(i).sph_theta=0;    chanlocs(i).sph_phi=0;    chanlocs(i).sph_radius=0;    endr.chanlocs=chanlocs;if r.sample1    s1=r.sample1;else    s1=((r.time1 * r.rate)+1);    r.sample1=s1;endif r.sample2    s2=r.sample2;else    if r.time2        s2=((r.time2 * r.rate)+1);        if (s2 > r.totsamples)|(s2 < s1); s2=r.totsamples; end    else        s2=r.totsamples;    endend        eeg=read_eep_cnt(file,s1,s2);r.nsmpl=eeg.npnt;r.time=eeg.time;r.dat=eeg.data;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -