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.

Create FITS file


fptr = createFile(filename)


fptr = createFile(filename) creates a FITS file. An error will be returned if the specified file already exists, unless the filename is prefixed with an exclamation point (!). In that case CFITSIO will overwrite (delete) any existing file with the same name. Specify filename as a character vector or string scalar.

This function corresponds to the fits_create_file (ffinit) function in the CFITSIO library C API.


Create a new FITS file.

fptr = fits.createFile('myfile.fits');
fits.createImg(fptr,'uint8',[256 512]);