Hi Sophia,
To extract and convert a specific column from certain rows of a table into a cell array, you can use "table2cell" like this:
% Assume 'roster' is your table and 'rownumber' is a vector of row indices
rownumber = [1, 2, 3, 4]; % Example row indices
% 'Column4' is the name of the column you want to extract
PTID = table2cell(roster(rownumber, 'Column4'));
To read more about "table2cell" function please refer to the below documentation link:
I hope this helps!