0001 function obj = vb_batch_variable_table_remove_column(obj, column_name)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
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
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
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
0050
0051 if nargout < 1
0052 error('function caller should receive this object.');
0053 end