Main Content

matlab.io.fits.deleteCol

Delete column from table

Syntax

deleteCol(fptr,colnum)

Description

deleteCol(fptr,colnum) deletes the column from an ASCII or binary table.

This function corresponds to the fits_delete_col (ffdcol) function in the CFITSIO library C API.

Examples

Delete the second column in a binary table.

import matlab.io.*
srcFile = fullfile(matlabroot,'toolbox','matlab','demos','tst0012.fits');
copyfile(srcFile,'myfile.fits');
fileattrib('myfile.fits','+w');
fprintf('Before:  '); fitsdisp('myfile.fits','index',2,'mode','min');
fptr = fits.openFile('myfile.fits','readwrite');
fits.movAbsHDU(fptr,2);
fits.deleteCol(fptr,2);
fits.closeFile(fptr);
fprintf('After :  '); fitsdisp('myfile.fits','index',2,'mode','min');

See Also