This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

matlab.io.fits.deleteKey

Delete key by name

Syntax

deleteKey(fptr,keyname)

Description

deleteKey(fptr,keyname) deletes a keyword by name. Specify keyname as a character vector or string scalar.

This function corresponds to the fits_delete_key(ffdrec) function in the CFITSIO library C API.

Examples

import matlab.io.*
srcFile = fullfile(matlabroot,'toolbox','matlab','demos','tst0012.fits');
copyfile(srcFile,'myfile.fits');
fileattrib('myfile.fits','+w');
fprintf('Before key deletion...\n');
fitsdisp('myfile.fits','index',1);
fptr = fits.openFile('myfile.fits','readwrite');
fits.deleteKey(fptr,'DATE');
fits.closeFile(fptr);
fprintf('\n\n\nAfter key deletion...\n');
fitsdisp('myfile.fits','index',1);