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

📄 eegplot.m

📁 含有多种ICA算法的eeglab工具箱
💻 M
📖 第 1 页 / 共 5 页
字号:
% Revision 1.42  2002/08/15 00:45:47  arno% typo%% Revision 1.41  2002/08/14 01:20:41  arno% close or cancel%% Revision 1.40  2002/08/13 00:06:29  arno% slidder color and scale title%% Revision 1.39  2002/08/12 18:58:58  arno% inputdlg2%% Revision 1.38  2002/08/12 01:18:40  arno% debug last%% Revision 1.37  2002/08/12 01:15:09  arno% update color%% Revision 1.36  2002/08/12 00:27:16  arno% color%% Revision 1.35  2002/08/11 23:10:04  arno% text edit%% Revision 1.34  2002/08/11 23:07:48  arno% done for title%% Revision 1.33  2002/08/11 22:47:11  arno% update color%% Revision 1.32  2002/08/08 21:03:56  arno% debugging continuous window select%% Revision 1.31  2002/08/08 00:24:43  arno% header%% Revision 1.30  2002/08/08 00:20:59  arno% adding colmodif option%% Revision 1.29  2002/08/07 17:38:26  arno% debugging%% Revision 1.28  2002/07/31 16:53:36  arno% changing button size%% Revision 1.27  2002/07/31 16:08:35  arno% debugging epoch problem%% Revision 1.26  2002/07/31 01:08:46  arno% resizing button%% Revision 1.25  2002/07/31 01:07:06  arno% debugging but label%% Revision 1.24  2002/07/31 01:05:07  arno% optional button label%% Revision 1.23  2002/07/30 19:37:49  arno% debug wincolor%% Revision 1.22  2002/07/30 19:22:57  arno% creating new argument for selecting colors%% Revision 1.21  2002/07/30 17:15:06  arno% adding multiple window plotting%% Revision 1.20  2002/07/30 15:16:41  arno% debugging frequency axis%% Revision 1.19  2002/07/26 21:58:03  arno% same%% Revision 1.18  2002/07/26 21:57:21  arno% debugging x axis%% Revision 1.17  2002/07/24 01:37:20  arno% debugging submean%% Revision 1.16  2002/07/24 01:28:09  arno% default spacing -> 3 stds%% Revision 1.15  2002/07/24 01:25:19  arno% default amplitude to standard deviation%% Revision 1.14  2002/07/23 16:26:01  arno% debugging slidder and X axis%% Revision 1.13  2002/07/22 23:14:40  arno% adding one to the epoch number%% Revision 1.12  2002/06/27 01:48:02  arno% removing frequency option%% Revision 1.11  2002/06/27 01:42:48  scott% completed help message editing -sm & ad%% Revision 1.10  2002/06/26 22:12:30  arno% debugging slider and editing%% Revision 1.9  2002/06/26 21:29:14  arno% editing header%% Revision 1.8  2002/06/26 18:39:33  scott% Edited help message -- see ??? for points needing more clarification. -sm%% Revision 1.7  2002/06/25 01:19:49  arno% update tag position%% Revision 1.6  2002/06/25 01:05:45  arno% new version with zoom%% Revision 1.3  2002/05/02 21:27:01  arno% reject button debugging%% Revision 1.2  2002/04/30 18:16:33  arno% conidtional REJECT button apparition%% Revision 1.1  2002/04/05 17:39:45  jorn% Initial revision%% 4/01 version 3 Arnaud Delorme, CNL / Salk Institute, La Jolla CA (arno@salk.edu)% 4-28-01 change popup windows; regroup drawing functions; add the trials tags  -ad% 4-29-01 colored timerange selection with mouse; g.time, electrode and value online display -ad % 4-30-01 reorganize menus and buttons, add new ones; electrode selection with mouse; output -ad % 5-01-01 multisignal display, add boudary contraints  -ad% 9-11-01 debugging, inversing Y direction for everything -ad% 9-16-01 normalization of the positions of button (PC and UNIX compatibility) -ad% 9-26-01 using 'key', value, matlab calling convention -ad% 10-10-01 adding 'xgrid', 'ygrid', 'color', 'freq' options  -ad% 11-10-01 whole restructuration of userdata variable, regroupment in g -ad% 12-10-01 add trial number (top) and trials limits (bottom) for EEG trials -ad   % 01-25-02 reformated help & license -ad % 03-04-02 preserve data 3D structure (to avoid reserving new memory:worked) -ad % 03-08-02 debug cancel and reject button -ad % 03-15-02 added readlocs and the use of eloc input structure -ad % 03-15-02 re-program noui version -ad % 03-17-02 debugging and text -ad & sm% 03-20-02 more complex names for the callback variables -ad & sm% 03-22-02 change help message -ad & lf% ---------------------------------------------------------------------- % from an original version by Colin Humphries, 5/98  % CNL / Salk Institute, La Jolla CA (colin@salk.edu) % 5-14-98 v2.1 fixed bug for small-variance data -ch% 1-31-00 v2.2 exchanged meaning of > and >>, < and << -sm% 8-15-00 v2.3 turned on SPACING_EYE and added int vector input for eloc_file -sm% 12-16-00 added undocumented figure position arg (if not 'noui') -sm% internal variables structure% All in g except for Eposition and Eg.spacingwhich are inside the boxes%% gcf%    1 - winlength%    2 - srate %    3 - children% 'backeeg' axis%    1 - trialtag%    2 - g.winrej%    3 - nested call flag% 'eegaxis'%    1 - data%    2 - colorlist%    3 - submean    % on or off, subtract the mean%    4 - maxfreq    % empty [] if no gfrequency content% 'buttons hold other informations' Eposition for instance hold the current postitionfunction [outvar1] = eegplot(data, varargin); % p1,p2,p3,p4,p5,p6,p7,p8,p9)% Defaults (can be re-defined):DEFAULT_PLOT_COLOR = { [0 0 1], [0.7 0.7 0.7]};         % EEG line colortry, icadefs;	DEFAULT_FIG_COLOR = BACKCOLOR;	BUTTON_COLOR = GUIBUTTONCOLOR;catch	DEFAULT_FIG_COLOR = [1 1 1];	BUTTON_COLOR =[0.8 0.8 0.8];end;DEFAULT_AXIS_COLOR = 'k';         % X-axis, Y-axis Color, text ColorDEFAULT_GRID_SPACING = 1;         % Grid lines every n secondsDEFAULT_GRID_STYLE = '-';         % Grid line styleYAXIS_NEG = 'off';                % 'off' = positive up DEFAULT_NOUI_PLOT_COLOR = 'k';    % EEG line color for noui option                                  %   0 - 1st color in AxesColorOrderSPACING_EYE = 'on';               % g.spacingI on/offSPACING_UNITS_STRING = '';        % '\muV' for microvolt optional units for g.spacingI Ex. uVDEFAULT_AXES_POSITION = [0.0964286 0.15 0.842 0.788095];                                  % dimensions of main EEG axesORIGINAL_POSITION = [50 50 800 500];                                  if nargin < 1   help eegplot   returnend				  % %%%%%%%%%%%%%%%%%%%%%%%%% Setup inputs% %%%%%%%%%%%%%%%%%%%%%%%%if ~isstr(data) % If NOT a 'noui' call or a callback from uicontrols   try       options = varargin;       for index = 1:length(options)           if iscell(options{index}) & ~iscell(options{index}{1}), options{index} = { options{index} }; end;       end;       if ~isempty( varargin ), g=struct(options{:});        else g= []; end;   catch   		disp('eegplot() error: calling convention {''key'', value, ... } error'); return;   end;			    try, g.srate; 		    catch, g.srate		= 256; 	end;   try, g.spacing; 			catch, g.spacing	= 0; 	end;   try, g.eloc_file; 		catch, g.eloc_file	= 0; 	end; % 0 mean numbered   try, g.winlength; 		catch, g.winlength	= 5; 	end; % Number of seconds of EEG displayed   try, g.position; 	    catch, g.position	= ORIGINAL_POSITION; 	end;   try, g.title; 		    catch, g.title		= ['Scroll activity -- eegplot()']; 	end;   try, g.trialstag; 		catch, g.trialstag	= -1; 	end;   try, g.winrej; 			catch, g.winrej		= []; 	end;   try, g.command; 			catch, g.command	= ''; 	end;   try, g.tag; 				catch, g.tag		= 'EEGPLOT'; end;   try, g.xgrid;		    catch, g.xgrid		= 'off'; end;   try, g.ygrid;		    catch, g.ygrid		= 'off'; end;   try, g.color;		    catch, g.color		= 'off'; end;   try, g.submean;			catch, g.submean	= 'on'; end;   try, g.children;			catch, g.children	= 0; end;   try, g.limits;		    catch, g.limits	    = [0 1000*(size(data,2)-1)/g.srate]; end;   try, g.freqlimits;	    catch, g.freqlimits	= []; end;   try, g.dispchans; 		catch, g.dispchans  = size(data,1); end;   try, g.wincolor; 		catch, g.wincolor   = [ 0.8345 1 0.9560]; end;   try, g.butlabel; 		catch, g.butlabel   = 'REJECT'; end;   try, g.colmodif; 		catch, g.colmodif   = { g.wincolor }; end;   try, g.scale; 		    catch, g.scale      = 'on'; end;   try, g.events; 		    catch, g.events      = []; end;   if ndims(data) > 2   		g.trialstag = size(	data, 2);   	end;	         gfields = fieldnames(g);   for index=1:length(gfields)      switch gfields{index}      case {'spacing', 'srate' 'eloc_file' 'winlength' 'position' 'title' ...               'trialstag'  'winrej' 'command' 'tag' 'xgrid' 'ygrid' 'color' 'colmodif'...               'freqlimits' 'submean' 'children' 'limits' 'dispchans' 'wincolor' 'butlabel' 'scale' 'events' },;      otherwise, error(['eegplot: unrecognized option: ''' gfields{index} '''' ]);      end;   end;   if length(g.srate) > 1   		disp('Error: srate must be a single number'); return;   end;	   if length(g.spacing) > 1   		disp('Error: ''spacing'' must be a single number'); return;   end;	   if length(g.winlength) > 1   		disp('Error: winlength must be a single number'); return;   end;	   if isstr(g.title) > 1   		disp('Error: title must be is a string'); return;   end;	   if isstr(g.command) > 1   		disp('Error: command must be is a string'); return;   end;	   if isstr(g.tag) > 1   		disp('Error: tag must be is a string'); return;   end;	   if length(g.position) ~= 4   		disp('Error: position must be is a 4 elements array'); return;   end;	   switch lower(g.xgrid)	   case { 'on', 'off' },; 	   otherwise disp('Error: xgrid must be either ''on'' or ''off'''); return;   end;	   switch lower(g.ygrid)	   case { 'on', 'off' },; 	   otherwise disp('Error: ygrid must be either ''on'' or ''off'''); return;   end;	   switch lower(g.submean)	   case { 'on' 'off' };	   otherwise disp('Error: submean must be either ''on'' or ''off'''); return;   end;	   switch lower(g.scale)	   case { 'on' 'off' };	   otherwise disp('Error: scale must be either ''on'' or ''off'''); return;   end;	      if ~iscell(g.color)	   switch lower(g.color)		case 'on', g.color = { 'k', 'm', 'c', 'b', 'g' }; 		case 'off', g.color = { [ 0 0 0.4] };  		otherwise 		 disp('Error: color must be either ''on'' or ''off'' or a cell array'); return;	   end;	   end;   if length(g.dispchans) > size(data,1)	   g.dispchans = size(data,1);   end;   if ~iscell(g.colmodif)   		g.colmodif = { g.colmodif };   end;   if any(isnan(data(:))) & strcmpi(g.submean, 'on')       g.submean = 'nan';   end;      % convert color to modify into array of float   % -------------------------------------------   for index = 1:length(g.colmodif)	   tmpcolmodif(index) = g.colmodif{index}(1) + g.colmodif{index}(2)*10 + g.colmodif{index}(3)*100;   end;   g.colmodif = tmpcolmodif;      [g.chans,g.frames, tmpnb] = size(data);   g.frames = g.frames*tmpnb;    if g.spacing == 0    maxindex = min(1000, g.frames);  	stds = std(data(:,1:maxindex),[],2);	stds = sort(stds);	if length(stds) > 2		stds = mean(stds(2:end-1));	else		stds = mean(stds);	end;	    g.spacing = stds*3;      if g.spacing > 10      g.spacing = round(g.spacing);    end    if g.spacing  == 0 | isnan(g.spacing)

⌨️ 快捷键说明

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