Add trial index to tag object. [USAGE] [tag_obj] = vb_tag_add_trial_index(tag_obj, ix); [IN] ix : index of trial data(which is stored in vb_trial_extractor object) [Nx1] [OUT] tag_obj : updated tag object. Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [tag_obj] = vb_tag_add_trial_index(tag_obj, ix) 0002 % Add trial index to tag object. 0003 % [USAGE] 0004 % [tag_obj] = vb_tag_add_trial_index(tag_obj, ix); 0005 % [IN] 0006 % ix : index of trial data(which is stored in vb_trial_extractor object) [Nx1] 0007 % [OUT] 0008 % tag_obj : updated tag object. 0009 % 0010 % Copyright (C) 2011, ATR All Rights Reserved. 0011 % License : New BSD License(see VBMEG_LICENSE.txt) 0012 0013 % 0014 % --- Previous check 0015 % 0016 if ~exist('tag_obj', 'var') 0017 error('tag_obj is a required parameter.'); 0018 end 0019 if ~exist('ix', 'var') 0020 error('ix is a required parameter.'); 0021 end 0022 0023 if size(ix, 2) ~= 1 0024 error('The shape of index should be [Nx1]'); 0025 end 0026 0027 0028 % 0029 % --- Main Procedure 0030 % 0031 tag_obj.trial_ix = [tag_obj.trial_ix; ix]; 0032 0033 % 0034 % --- After check 0035 % 0036 if nargout ~= 1 0037 error('function caller should receive tag_obj.'); 0038 end