%% Read Specified Columns of a FITS File Binary Table
% Read all data for the first, second, and fifth columns of the binary table of a FITS file.
% Determine the number of rows in the binary table.

info      = fitsinfo('tst0012.fits');
rowend    = info.BinaryTable.Rows;

% Read first, second, and fifth columns of the binary table.

tableData = fitsread('tst0012.fits','binarytable', ...
                    'Info',info,...
                    'TableColumns',[1 2 5]);

% Copyright 2020 The MathWorks, Inc.