Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

matlab.io.fits.getColName

Table column name

Syntax

[colnum,colname] = getColNum(fptr,templt,casesen)

Description

[colnum,colname] = getColNum(fptr,templt,casesen) gets the table column numbers and names of the columns whose names match an input template name. If casesen is true, then the column name match is case-sensitive. casesen defaults to false.

The input column name template may be either the exact name of the column to be searched for, or it may contain wildcard characters (*, ?, or #), or it may contain the integer number of the desired column (with the first column = 1). The '*' wildcard character matches any sequence of characters (including zero characters) and the '?' character matches any single character. The # wildcard matches any consecutive string of decimal digits (0-9).

Examples

Return all the columns starting with the letter 'C'.

import matlab.io.*
fptr = fits.openFile('tst0012.fits');
fits.movAbsHDU(fptr,2);
[nums,names] = fits.getColName(fptr,'C*');
fits.closeFile(fptr);
Was this topic helpful?