Lab: Scripts
Scripts
Script Files
A script file (*.m) allows you to put all your commands in a text file and then execute the file.
- Able to include basic programming constructs (loops, decision statements)
- Commands are executed sequentially.
- Execute script files by typing the name of the file at the prompt. (
>> Image_processingto runImage_processing.m). - Put all script files for a project in the directory the session presides in.
Single line comments start with a % and block comments start with %{ and end with %}.
Steps to create a script file called Image_processing.m
- change pwd:
>> cd C:\...\...to the folder where your file will be saved. - Launch Matlab editor from the toolbar.
- Save as
Image_processing.m.
Linked from Computational Modeling