Here's an example adapted from the one linked above:
info = fitsinfo('tst0012.fits')
info =
struct with fields:
Filename: '/local-ssd/asvenkat/MATLAB/toolbox/matlab/demos/tst0012.fits'
FileModDate: '13-Mar-2001 05:07:46'
FileSize: 109440
Contents: {1×5 cell}
PrimaryData: [1×1 struct]
BinaryTable: [1×1 struct]
Unknown: [1×1 struct]
Image: [1×1 struct]
AsciiTable: [1×1 struct]
info.PrimaryData.Keywords
ans =
25×3 cell array
{'SIMPLE' } {'T' } {' Standard FITS file …'}
{'BITPIX' } {[ -32]} {' No. of bits per pixel …'}
{'NAXIS' } {[ 2]} {' No. of axes in matrix …'}
{'NAXIS1' } {[ 102]} {' No. of pixels in X …'}
{'NAXIS2' } {[ 109]} {' No. of pixels in Y …'}
{'EXTEND' } {'T' } {' There may be FITS extensions …'}
{'BLOCKED'} {'T' } {' The file may be blocked …'}
{0×0 char } {0×0 char } {0×0 char }
{'CDELT1' } {[ 3.1000]} {' Coordinate increment …'}
{'CRVAL1' } {[ 1.2991e+03]} {' Coordinate of reference pixel …'}
{'CRPIX1' } {[ 12.3000]} {' Reference pixel in X …'}
{0×0 char } {0×0 char } {0×0 char }
{'CDELT2' } {[ -0.1700]} {' Coordinate increment …'}
{'CRVAL2' } {[ -102.4000]} {' Coordinate of reference pixel …'}
{'CRPIX2' } {[ -2.0318e+03]} {' Reference pixel in Y …'}
{0×0 char } {0×0 char } {0×0 char }
{'OBJECT' } {'Wave 32-bit FP'} {' Name of image …'}
{'ORIGIN' } {'ESO' } {' File was prepared at ESO-Garching …'}
{'DATE' } {'20/08/92' } {' Creation data of this file …'}
{0×0 char } {0×0 char } {0×0 char }
{'COMMENT'} {0×0 char } {' This test file was created by P.Grosbol, ES…'}
{0×0 char } {0×0 char } {0×0 char }
{'COMMENT'} {0×0 char } {' Simple 32-bit FP sine wave pattern for test…'}
{0×0 char } {0×0 char } {0×0 char }
{'END' } {0×0 char } {0×0 char }