Contenuto principale

matlab.io.fits.readKeyCmplx

Read key as complex scalar value

Syntax

[value,comment] = matlab.io.fits.readKeyCmplx(fptr,keyname)

Description

[value,comment] = matlab.io.fits.readKeyCmplx(fptr,keyname) returns the specified key value and comment. Specify the keyname argument as a string scalar or character vector. The function returns value as a complex double scalar value and comment as a character vector.

Examples

collapse all

Create a new FITS file and add an image and a complex-valued keyword to it.

import matlab.io.*
fptr = fits.createFile("myfile.fits");
fits.createImg(fptr,"uint8",[20 30])
fits.writeKey(fptr,"mykey",sqrt(2*i),"square root of 2i")

Read the complex-valued keyword and the comment. Then close and delete the file.

[value,comment] = fits.readKeyCmplx(fptr,"mykey")
value = 
1.0000 + 1.0000i
comment = 
'square root of 2i'
fits.closeFile(fptr)
delete myfile.fits

Tips

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