You are here

Script Files

20 January, 2016 - 09:21

A script is a file containing a sequence of MATLAB statements. Script files have a filename extension of .m. By typing the filename at the command prompt, we can run the script and obtain results in the command window.

media/image2.png
Figure 4.1 Number of m-files are displayed in the Current Folder sub-window. 
 

A sample m-file named ThermalConductivity.m is displayed in Text Editor below. Note the triangle (in green) run button in the tool bar, pressing this button executes the script in the command window.

media/image3.png
Figure 4.2 The content of ThermalConductivity.m file is displayed in Text Editor. 
 

Now let us see how an m-file is created and executed.