Suppose you have a table tbl
with column names 'Name'
, 'Age'
, 'Gender'
, etc. and you want to select only the columns 'Name'
and 'Gender'
, you can do this by indexing with a cell array of column names as shown below:
main.m203 chars6 lines
The resulting selectedColumns
table will only have columns 'Name'
and 'Gender'
.
gistlibby LogSnag