Contenido principal

matlab.io.fits.getNumCols

Get number of columns in table

Syntax

ncols = matlab.io.fits.getNumCols(fptr)

Description

ncols = matlab.io.fits.getNumCols(fptr) returns the number of columns in the current FITS table.

Examples

collapse all

Open a sample FITS file that has a table in the second HDU. Get the number of columns in the table. Then close the file.

import matlab.io.*
fptr = fits.openFile("tst0012.fits");
fits.movAbsHDU(fptr,2);
ncols = fits.getNumCols(fptr)
ncols = 
13
fits.closeFile(fptr)

Tips

  • This function corresponds to the fits_get_num_cols (ffgncl) function in the CFITSIO library C API.

  • To use this function, you must be familiar with the CFITSIO C interface. You can access the CFITSIO documentation at the CFITSIO website.

Extended Capabilities

expand all

Version History

expand all