MATLAB implementation of IGRF11 fortran code as function for calculating Earth mean magnetic field. Implementation has been modified to default to GPS reference coordinates with output B components North, East, and Vertical. Spherical harmonic coefficients are derived from downloaded Excel file.
Documentation has been improved and the function now returns proper values for the current epoch. A useful IGRF tool for MATLAB users that can be used for individual points or for global grids. No limit checking on lat/lon values; users will need to check their own inputs.
File is insufficiently documented (for example, the spherical coefficients have to be loaded before the main program can run) and post 2009 results differ significantly from those calculated by other software implementations of IGRF.
03 Oct 2010
Error noted by Mark Shore for fyear>=2000 fixed. GHcoefficients.mat version of spherical harmonic coefficients added. Code checked against results kindly provided by Mark Shore.