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.writeKeyUnit

Write physical units string

Syntax

writeKeyUnit(fptr,keyname,unit)

Description

writeKeyUnit(fptr,keyname,unit) writes the physical units into an existing keyword. fptr is created using the fits.createFile function. Specify keyname and unit as a character vector or string scalar.

This function corresponds to the fits_write_key_unit (ffpunt) function in the CFITSIO library C API.

Examples

import matlab.io.*
fptr = fits.createFile('myFitsFile.fits');
fits.createImg(fptr,'long_img',[10 20]);
fits.writeKey(fptr,'VELOCITY',12.3,'orbital speed');
fits.writeKeyUnit(fptr,'VELOCITY','km/s');
fits.closeFile(fptr);

See Also