matlab.io.fits.createTbl
Create new ASCII or binary table extension
Syntax
fptr = matlab.io.fits.createTbl(fptr,tbltype,nrows,ttype,tform,tunit,extname)
Description
fptr = matlab.io.fits.createTbl(fptr,tbltype,nrows,ttype,tform,tunit,extname)
creates a new ASCII or binary table extension. Specify tbltype as
either "binary" or "ascii". Specify
nrows as the initial number of rows for the table (typically
zero). Specify ttype as a string array or cell array of character
vectors containing names for the columns of the table. Specify
tunit as a string array or cell array of character vectors
containing the units for each column, or an empty array if no units are desired.
Optionally specify the extname argument as a string scalar or
character vector containing the extension name.
The tform argument contains the format of the column, specified as a
string array or cell array of character vectors. For binary tables, specify
tform array elements in the form of
",
where rt" is the repeat count and
r is one of these letters.t
Letter in Binary tform Array Element | Corresponding FITS Data Type |
|---|---|
A | ASCII character |
B | Byte or uint8
|
C | Complex (single precision) |
D | Double precision |
E | Single precision |
I | int16
|
J | int32
|
K | int64 |
L | Logical |
M | Complex (double precision) |
X | Bit (int8 zeros and ones) |
You can also specify a column to have variable width by specifying elements of
tform using the form
"1P or
t""1Q, where
t" specifies the data type as shown
in the previous table.t
For ASCII tables, specify tform using one of these forms.
Form of tform | Corresponding FITS Data Type |
|---|---|
"I | int16 column with width
|
"A | ASCII column with width
|
"F | Fixed point with width
and precision
|
"E | Single precision with width
and precision
|
"D | Double precision with width
and precision
|
Examples
Tips
This function corresponds to the
fits_create_tbl(ffcrtb) 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.