Script Files
Script Files
Script Files
All of the pre-built commands that you use in
MATLAB® are script files or functions (plot, mean,
std, exp, cosd, …)
MATLAB® allows the user to create his/her own
customized m-files for specific applications or
problems.
A script file is simply a collection of executable
MATLAB® commands. To create a new script file, click
on the New Script icon on the left side of the Home Tab.
Click on New
Script
Script Files Creates Blank
Script File
Script File: Procedure
1. Type a set of executable commands in the editor window.
2. Save the file in an appropriate folder. When you pick a
name for the file you must follow the same rules that
MATLAB has for naming variables.
3. Set the current directory in MATLAB® to the same place
where you saved the script file.
4. To run the script file: Hit the Green Run Arrow in the Editor
window or simply type the name of the file (without the .m
extension) at the command prompt in the MATLAB
command window.