File Exchange

image thumbnail

IGRF Magnetic Field

version (1010 KB) by Charles Rino
Compute IGRF mean earth magnetic field


Updated 04 Oct 2010

View Version History

View License

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.

Screenshot created by Demo_igrf11syn

Cite As

Charles Rino (2020). IGRF Magnetic Field (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)


This is straight forward and easy to use.

Mark Shore

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.

Joaquim Luis

You may want to look at this too.
It's very fast (MEX) and point-and-click driven

Mark Shore

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.

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!