I would like to subset a table into columns before a certain variable and columns after that variable. Is there a way to locate a column number within a table? Is there a more clever way to do this?
load patientsBloodPressure = [Systolic Diastolic];T = table(Gender,Age,Smoker,BloodPressure,'RowNames',LastName);A = *findColNumber*(T, 'Age'); % Some function that will locate the column number of 'Age'.
T1 = T(:, 1:A);T2 = T(:, A+1:end);
'patients' is a standard example data set included in R2014a. Entering the command 'load patients' should load the relevant data.
Thanks!
Best Answer