Home > functions > gui > batch > batch_variable_table > vb_batch_variable_table_remove_column.m

vb_batch_variable_table_remove_column

PURPOSE ^

remove column

SYNOPSIS ^

function obj = vb_batch_variable_table_remove_column(obj, column_name)

DESCRIPTION ^

 remove column
 [USAGE]
    obj = vb_batch_variable_add_column(<obj>, <column_name>);
 [IN]
            obj : vb_batch_variable_table object
    column_name : remove column name such as '$SUBJECT$' [STRING]
 [OUT]
    obj : vb_batch_variable_table 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 obj = vb_batch_variable_table_remove_column(obj, column_name)
0002 % remove column
0003 % [USAGE]
0004 %    obj = vb_batch_variable_add_column(<obj>, <column_name>);
0005 % [IN]
0006 %            obj : vb_batch_variable_table object
0007 %    column_name : remove column name such as '$SUBJECT$' [STRING]
0008 % [OUT]
0009 %    obj : vb_batch_variable_table object
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if ~exist('obj', 'var')
0018     error('obj is a required parameter.');
0019 end
0020 if ~exist('column_name', 'var')
0021     error('column_name is a required parameter.');
0022 end
0023 if ~ischar(column_name) || isempty(column_name)
0024     error('invalid column name is given');
0025 end
0026 
0027 %
0028 % --- Main Procedure
0029 %
0030 
0031 ix = strmatch(column_name, obj.column_name_list, 'exact');
0032 if isempty(ix)
0033     warning(['Column name: ' column_name ' does not exist.']);
0034 else
0035     % Remove column
0036     obj.column_name_list(ix(1)) = [];
0037     obj.table(:, ix(1)) = [];
0038 
0039     if isempty(obj.column_name_list)
0040         obj.column_name_list = cell(0);
0041     end
0042     if isempty(obj.table)
0043         obj.table = cell(1,0);
0044     end
0045     
0046 end
0047 
0048 %
0049 % --- After check
0050 %
0051 if nargout < 1
0052     error('function caller should receive this object.');
0053 end

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