File Exchange

image thumbnail

Ising Model and Metropolis Algorithm

version 1.2 (4.74 MB) by

Learn how to use the Metropolis algorithm to simulate the Ising model of a ferromagnet in MATLAB.



View License

This example integrates computation into a physics lesson on the Ising model of a ferromagnet. Exercises are included at the end. Students learn how to implement the Metropolis algorithm, write modular programs, plot physical relationships, run for-loops in parallel, and develop machine learning algorithms to classify phases and to predict the temperature of a 2D configuration of spins.
Note on required products:
MATLAB is the only required product to run the live script, although some of the exercises use Statistics and Machine Learning Toolbox, Parallel Computing Toolbox, and Neural Network Toolbox.

Comments and Ratings (1)

kangxin mo




Added an exercise to parallelize the Metropolis algorithm on a GPU.


Updated summary description.


Revised based on team review.

MATLAB Release
MATLAB 9.2 (R2017a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today