Skip to main content
Logo image

Section 2.1 Scripts

A MATLAB script is a .m file that stores a sequence of MATLAB commands. When you run the script, MATLAB reads the file from top to bottom and executes each command in order. Scripts let you save work you would otherwise type in the Command Window so you can rerun it quickly.