Contenuto principale

matlab.io.fits.deleteRows

Delete rows from table

Syntax

matlab.io.fits.deleteRows(fptr,firstrow,nrows)

Description

matlab.io.fits.deleteRows(fptr,firstrow,nrows) deletes rows from an ASCII or binary table.

Examples

collapse all

Make a copy of a sample FITS file and examine the structure of a table in the file. The table has 11 rows and 13 columns.

import matlab.io.*
copyfile("tst0012.fits","myfile.fits")
fitsdisp("myfile.fits",Index=2,Mode="min")
HDU 2:  BINARY_TBL [ 11 13 ]

Delete the fourth, fifth, and sixth rows from the table. The table now has 8 rows and 13 columns.

fptr = fits.openFile("myfile.fits","readwrite");
fits.movAbsHDU(fptr,2);
fits.deleteRows(fptr,4,3)
fits.closeFile(fptr)
fitsdisp("myfile.fits",Index=2,Mode="min")
HDU 2:  BINARY_TBL [ 8 13 ]

Delete the new file myfile.fits.

delete myfile.fits

Tips

  • This function corresponds to the fits_delete_rows (ffdrow) 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