0001 function [tag_obj] = vb_tag_remove_trial_index(tag_obj, ix)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
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
0030 remove_ix = [];
0031 for k=1:length(ix)
0032 remove_ix = [remove_ix; find(tag_obj.trial_ix == ix(k))];
0033 end
0034 if ~isempty(remove_ix)
0035 tag_obj.trial_ix(remove_ix) = [];
0036 end
0037
0038
0039
0040
0041 if nargout ~= 1
0042 error('function caller should receive updated tag_obj.');
0043 end