function [thelabels,data,theCol] = GetColumnAndRemove(thelabels,data,which)
%[thelabels,data,theCol] = GetColumnAndRemove(thelabels,data,which)
%finds matching column and removes
%
%INPUT
%thelabels = a cell array of strings that contains the labels for the data columns
%data = an array that contains the numeric data (can be any type of array
%which = the label of the column to remover
%
%OUTPUT
%labels =the label array with (which) removed 
%data = the data array with the (which) column removed
%theCol = the Data removed from the data array
%
%Written by K. Steffen (ksteffen@unm.edu) at the University of New Mexico,
%Department of Earch and Planetary Science
%Copyright 2003 Kurt Steffen
%
%Last Modified June 17, 2003

col = GetColumnsGeneral(thelabels,which);
col = col(2,:);
theCol = data(:,[col{:}]);
col = cell2double(col);
col = sort(col);
col = double2cell(col);
data(:,[col{end:-1:1}]) = []; 
thelabels([col{end:-1:1}]) = [];