Create analog trigger. [USAGE] vb_analog_trigger_new(ch_name, slope trig_level); [IN] ch_name : extract trigger from this channel [string] slope : trigger slope. ('low_to_high' or 'high_to_low') [string] trig_level : factor for amplitude threshold. [OUT] obj : analog_trigger object [see also] vb_get_trigger_event Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [obj] = vb_analog_trigger_new(ch_name, slope, trig_level) 0002 % Create analog trigger. 0003 % 0004 % [USAGE] 0005 % vb_analog_trigger_new(ch_name, slope trig_level); 0006 % [IN] 0007 % ch_name : extract trigger from this channel [string] 0008 % slope : trigger slope. ('low_to_high' or 'high_to_low') [string] 0009 % trig_level : factor for amplitude threshold. 0010 % [OUT] 0011 % obj : analog_trigger object 0012 % [see also] 0013 % vb_get_trigger_event 0014 % 0015 % Copyright (C) 2011, ATR All Rights Reserved. 0016 % License : New BSD License(see VBMEG_LICENSE.txt) 0017 0018 % 0019 % --- Previous check 0020 % 0021 if nargin < 3 0022 error('This function needs 3 argments. Please check your code.'); 0023 end 0024 if ~strcmp(slope, 'low_to_high') && ~strcmp(slope, 'high_to_low') 0025 error('trigger slope must be low_to_high or high_to_low'); 0026 end 0027 0028 % 0029 % --- Main Procedure 0030 % 0031 obj = vb_trigger_new(ch_name, 'analog', trig_level); 0032 0033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0034 % obj.FIELDNAMES SHOULD BE DEFINED FOR vb_get_trial_time_index 0035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0036 obj.slope = slope; 0037 0038 % 0039 % --- After check 0040 % 0041 if nargout < 1 0042 error('function caller should receive this object.'); 0043 end