Main Content

matlab.io.fits.deleteRecord

レコード番号に基づくキーの削除

構文

deleteRecord(fptr,keynum)

説明

deleteRecord(fptr,keynum) は、レコード番号に基づいてキーワードを削除します。

この関数は、CFITSIO ライブラリ C API の関数 fits_delete_record (ffdrec) に相当します。

プライマリ配列の 18 番目のキーワード ("ORIGIN") を削除します。

import matlab.io.*
srcFile = fullfile(matlabroot,'toolbox','matlab','demos','tst0012.fits');
copyfile(srcFile,'myfile.fits');
fileattrib('myfile.fits','+w');
fptr = fits.openFile('myfile.fits','readwrite');
card = fits.readRecord(fptr,18);
fits.deleteRecord(fptr,18);
fits.closeFile(fptr);