I've the following table and I want to swap the entries
tbl = table({'1', '2'; '2', '3'; '2', '3'; '3', '4'},'VariableNames', {'multicol'}); i_pts = 2; for i = i_pts searchval = num2str(i); temp_tbl = tbl(any(strcmp(tbl.multicol, searchval), 2), :); endtemp_tbl
Obtained output:
multicol ______________ {'1'} {'2'} {'2'} {'3'} {'2'} {'3'}
I'd like to obtain the following from the above output.
multicol ______________ {'2'} {'1'} {'2'} {'3'} {'2'} {'3'}
Any suggestion on how on this can be done?
Best Answer