Create trial object. The definition of trial data. [USAGE] [obj] = vb_trial_new(from, to, onset, label, trig_ix); [IN] trial |--------|--------| from onset to from : The sample number of start point. (sample number of continuous data.) to : The sample number of end point. onset : task starts from this sample number. [OUT] obj : trial object Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [obj] = vb_trial_new(from, to, onset) 0002 % Create trial object. 0003 % The definition of trial data. 0004 % 0005 % [USAGE] 0006 % [obj] = vb_trial_new(from, to, onset, label, trig_ix); 0007 % [IN] 0008 % trial |--------|--------| 0009 % from onset to 0010 % 0011 % from : The sample number of start point. 0012 % (sample number of continuous data.) 0013 % to : The sample number of end point. 0014 % onset : task starts from this sample number. 0015 % 0016 % [OUT] 0017 % obj : trial object 0018 % 0019 % Copyright (C) 2011, ATR All Rights Reserved. 0020 % License : New BSD License(see VBMEG_LICENSE.txt) 0021 0022 % 0023 % --- Previous check 0024 % 0025 if nargin < 3 0026 error('This function needs 5 fields. Please check your code.'); 0027 end 0028 0029 % 0030 % --- Main Procedure 0031 % 0032 obj = struct; 0033 obj.from = from; 0034 obj.to = to; 0035 obj.onset = onset; 0036 0037 % 0038 % --- After check 0039 % 0040 if nargout < 1 0041 error('function caller should receive trial object.'); 0042 end