function subset = selectFromTable(table, criterion)
% selectFromTable(list, criterion) 
% select a subset from a table 
% using the specified criterion
% Returns the indices of the selected items 
[nitems,nfields] = size(table);
selected = zeros(nitems, 1);
%!! Boolean: which items were selected.
for k=1:nitems
   selected(k) = feval(criterion, table(k,:));
   %!! Fill in the boolean for each item in the list
end
subset = find(selected); 
%!! Find the indices of the 1s in the boolean list
