Home > functions > gui > preAnalysis > trial_extractor > private > vb_tag_remove_trial_index.m

vb_tag_remove_trial_index

PURPOSE ^

remove trial index from tag.

SYNOPSIS ^

function [tag_obj] = vb_tag_remove_trial_index(tag_obj, ix)

DESCRIPTION ^

 remove trial index from tag.
 [USAGE]
    [tag_obj] = vb_tag_remove_trial_index(tag_obj, ix);
 [IN]
    ix : remove index number [Nx1]
 [OUT]
    tag_obj : updated tag_object.

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [tag_obj] = vb_tag_remove_trial_index(tag_obj, ix)
0002 % remove trial index from tag.
0003 % [USAGE]
0004 %    [tag_obj] = vb_tag_remove_trial_index(tag_obj, ix);
0005 % [IN]
0006 %    ix : remove index number [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 % --- Main Procedure
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 % --- After check
0040 %
0041 if nargout ~= 1
0042     error('function caller should receive updated tag_obj.');
0043 end

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005