International Geomagnetic Reference Field (IGRF) Model

Compute the Earth's magnetic field at points in space according to the IGRF model.

Download
Download

You are now following this Submission

Cite As

Drew Compston (2026). International Geomagnetic Reference Field (IGRF) Model (https://www.mathworks.com/matlabcentral/fileexchange/34388-international-geomagnetic-reference-field-igrf-model), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired by: IGRF Magnetic Field

Inspired: Geomagnetic Field Intensity Data

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.14.0

Changed years variable name to prevent error in newer MATLAB versions, as pointed out in a 8 Sep 2017 comment by David Koronczay.
Updated the website where coefficient files can be accessed as pointed out in a 17 Sep 2018 by Lutz Rastaetter.

Download
1.13.0

Added igrf1925 coefficients and made loadigrfcoefs.m more robust to different than 5 year gaps between coefficient files.

Download
1.12.0

Updated description text to reflect my most recent update: The newest 2015 coefficients are now included.

Download
1.11.0

.

Download
1.10.0

Includes 2015 coefficients (12th generation IGRF).

Download
1.9.0

Removed 'years' variable from loadigrfcoefs.mat.

Download
1.8.0

Apparently, the earlier bug pointed out by Michael on 25 Jan 2012 resurfaced. Presumably the fix I had implemented before got undone, so this update includes that fix again.

Download
1.7.0

Adjusted initial comment block in IGRF with correct definition of inclination using atan2 (rather than atan).

Download
1.6.0

Added capability to plot globe without mapping toolbox and minor bug fix.

Download
1.5.0

Provided my own ECEF to geodetic conversion routine.

Download
1.4.0

Fixed bug described in Michael's comment. For those interested, it resulted from mistakenly calculating dP using only the last latitude input rather than the vector.

Download
1.3.0

Fixed the issues detailed in Christie Harper's comment (including some additional ones relating to the differences between MATLAB's built-in ecef2lla and the free file exchange ecef2lla) and made some minor changes to speed up the functions slightly.

Download
1.0.0

Download