Cfitsio Toolkit - matlab.io.fits.createTbl
- : createTbl(file,
tbltype, nrows, ttype, tform)
- : createTbl(file,
tbltype, nrows, ttype, tform, tunit)
- : createTbl(file,
tbltype, nrows, ttype, tform, tunit, extname)
Create a new ASCII or bintable extension.
This is the equivalent of the cfitsio fits_create_tbl function.
Inputs
file - opened fits file.
tbltype - table type ’binary’ or ’ascii’.
nrows - initial number of rows (normally 0)
ttype - cell array of column type
tform - cell array of column format
tunit - cell array of column units
extname - optional extension name
ttype, tform, tunit are expected to be the same size.
Outputs
None
Examples
import_fits; fd = fits.createFile("test.fits"); ttype = {'Col1','Col2','Col3','Col4'}; tform = {'A9','A4','A3','A8'}; tunit = {'m','s','kg','km'}; fits.createTbl(fd,'binary',0,ttype,tform,tunit,'table-name'); fits.closeFile(fd);