
Available under Creative Commons-ShareAlike 4.0 International License.
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.

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.

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.
- 瀏覽次數:1457