Script M-files
A script M-file allows you to place MATLAB commands in a simple text file and then tell MATLAB to open the file and execute all commands precisely as if you had typed them at the Command Window prompt.
Script M-files must have file names ending with extension ‘.m’ and must contain only valid MATLAB code.